Compare commits

...

587 Commits

Author SHA1 Message Date
屈轩
e2149d01b6 fix(region): vendor update for qcloud nat status (#19513) 2024-02-20 16:00:07 +08:00
屈轩
c51150e756 fix(region): sync regional secgrouop (#19511) 2024-02-20 15:43:47 +08:00
Jian Qiu
ca7621cfb0 fix: filter organization nodes by policy tags (#19507)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-02-20 09:53:19 +08:00
Jian Qiu
8321100c51 fix: policy update description panic (#19509)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-02-20 09:28:38 +08:00
wanyaoqi
af3daeafb1 fix(host): script start guest donot force restart on monitor timeout (#19504) 2024-02-19 20:52:27 +08:00
屈轩
b240047cce fix(cloudproxy): cloudproxy service auth first (#19501) 2024-02-19 12:08:28 +08:00
wanyaoqi
092eaf6870 feat(region,host): guest numa allocate (#19496) 2024-02-18 19:35:13 +08:00
Jian Qiu
85efe57b22 fix: create params with require_ipv6 (#19492)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-02-18 10:35:14 +08:00
屈轩
797f2cc6d9 fix(region): vendor update for openstack https support (#19494) 2024-02-18 10:22:39 +08:00
Jian Qiu
dffd27e2bc fix: invalid token request too frequent (#19488)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-02-17 19:00:12 +08:00
Jian Qiu
579cba8b6f fix: organization sync panic on nil pointer of weight (#19486)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-02-12 21:08:47 +08:00
Jian Qiu
bbf5c4afb3 fix: project tag tree sql revise (#19485)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-02-11 10:47:30 +08:00
Jian Qiu
d0304058b2 fix: IModelManager add NewQuery to initialize query with params (#19482)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-02-11 00:26:16 +08:00
Jian Qiu
97fc5258df fix: sync error (#19483)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-02-10 18:00:28 +08:00
Jian Qiu
0f2e11591f fix: avaialble address6 api timeout (#19480)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-02-10 16:30:29 +08:00
wanyaoqi
5bef00a3a8 fix(region,host): rescue mode update initramfs, vnc login no passwd (#19477) 2024-02-09 09:23:00 +08:00
wanyaoqi
38834f3b1f fix(host-deployer): elfherader fd leak (#19475) 2024-02-08 14:11:24 +08:00
屈轩
52404a26d9 fix(region): avoid panic when change-owner missing domain_id (#19472) 2024-02-08 10:51:26 +08:00
屈轩
31bade24e7 fix(region): add read only filter for account and provider (#19469) 2024-02-07 15:33:03 +08:00
Jian Qiu
f6a9b77698 fix: project tag value tree can return sum of any field (#19465)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-02-07 11:52:03 +08:00
屈轩
85b6ad8a34 fix(region): trim tag space (#19467) 2024-02-07 11:04:29 +08:00
wanyaoqi
2069906d7b fix(host-deployer): xfs unlock panic (#19458) 2024-02-06 00:32:29 +08:00
Jian Qiu
eef9e48e02 feature: allow manager to preapre query context (#19455)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-02-06 00:01:26 +08:00
屈轩
1bd5f73365 fix(region): qcloud disks delete when vm deleted (#19453) 2024-02-05 17:54:51 +08:00
屈轩
70c280af77 fix(climc): support set bill report for azure account (#19450) 2024-02-05 15:14:17 +08:00
屈轩
08f92a8d89 fix(region): cloudpods ipv6 sync (#19445) 2024-02-05 11:24:10 +08:00
屈轩
0c4b30335b fix(region): cloudpods deploy api (#19447) 2024-02-05 11:23:45 +08:00
Jian Qiu
f3f9fa9886 fix: tenant cache sync deleted projects (#19441)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-02-05 08:45:10 +08:00
屈轩
bf320a5b32 fix(region): support set network tags (#19439) 2024-02-04 18:05:15 +08:00
屈轩
c5dcc6fa1d fix(region): avoid informer panic (#19431) 2024-02-04 16:29:00 +08:00
屈轩
317b8b7a3b fix(region): avoid filesystem sync error (#19436) 2024-02-04 15:19:15 +08:00
屈轩
1456f31d45 fix(region): auto set provider project id when change account project info (#19433) 2024-02-04 11:49:59 +08:00
gouqi11
b2de0282f6 fix(scheduledtask): fix deletedResource task (#19428)
Co-authored-by: 马鸿飞 <mahongfei@yunion.cn>
2024-02-04 10:42:53 +08:00
屈轩
9efb34f7c7 fix(webconsole): sort file list (#19409) 2024-02-03 23:28:40 +08:00
Jian Qiu
b03650d97f fix: fail to reset policy org_node_id to empty (#19426)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-02-03 23:19:53 +08:00
屈轩
31f6a4026d fix(region): auto create project by project mapping (#19407) 2024-02-02 17:37:00 +08:00
屈轩
74932360b5 fix(region): ipv6 free ip (#19418) 2024-02-02 17:15:18 +08:00
屈轩
629ca22509 fix(region): support public ipv6 addr sync (#19420) 2024-02-02 17:14:21 +08:00
Zexi Li
1e5d988346 Merge pull request #19422 from wanyaoqi/automated-cherry-pick-of-#19421-upstream-release-3.11
Automated cherry pick of #19421: fix(host): init from guest mem obj miss size
2024-02-02 16:53:39 +08:00
wanyaoqi
7662f88edc fix(host): init from guest mem obj miss size 2024-02-02 16:43:14 +08:00
Jian Qiu
a4758fbd15 fix: expand policy tags with org node tags (#19416)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-02-02 14:10:53 +08:00
gouqi11
c7d6b053e5 fix(commom): setStatus with notify hook (#19412)
Co-authored-by: 马鸿飞 <mahongfei@yunion.cn>
2024-02-01 20:44:44 +08:00
屈轩
59dcb4260d fix(region): ipv6 filter (#19411) 2024-02-01 18:52:48 +08:00
屈轩
483a97e6ad fix(keystone): optimized user list (#19404) 2024-02-01 16:43:12 +08:00
Jian Qiu
9e61ae2c63 fix: allow binding organization ids to policy (#19399)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-02-01 10:58:50 +08:00
屈轩
d6925ac5a9 fix(webconsole): support host ssh (#19387) 2024-02-01 10:58:19 +08:00
Jian Qiu
84f88b705b fix: sync unknown guest status when host ping (#19384)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-02-01 10:57:41 +08:00
屈轩
d3ec086f9c fix(common): auto disable 3des cipher suites (#19392) 2024-02-01 10:57:03 +08:00
屈轩
6d3551745b fix(region): avoid panic (#19402) 2024-02-01 10:12:01 +08:00
屈轩
f56e34ce77 fix(region): vendor update for sync ipv6 (#19398) 2024-01-31 20:57:32 +08:00
屈轩
5d55f60453 fix(region): cloudpods esxi disk create (#19390) 2024-01-31 17:30:32 +08:00
屈轩
681a43d160 fix(region): support managed ipv6 (#19395) 2024-01-31 17:29:55 +08:00
屈轩
0dbaba06d4 fix(region): project mapping key match at end of list (#19381) 2024-01-31 15:05:29 +08:00
Jian Qiu
c7c6477798 fix: vmware change config with cpu sockets (#19375)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-01-31 15:04:47 +08:00
Zexi Li
cd45fd7e6b fix(baremetal): admin nic is reset when added secondly (#19377) 2024-01-30 16:17:56 +08:00
屈轩
afbd0f922f fix(region): cancel pending delete (#19373) 2024-01-30 14:12:45 +08:00
Zexi Li
5c61e4c46c Merge pull request #19369 from swordqiu/automated-cherry-pick-of-#19368-upstream-release-3.11
Automated cherry pick of #19368: fix: server change ip addr recode
2024-01-30 10:23:53 +08:00
屈轩
de25515eb0 fix(region): vendor update for optimized aliyun rds backup sync (#19371) 2024-01-29 18:07:45 +08:00
Qiu Jian
0464bf5239 fix: server change ip addr recode 2024-01-29 17:10:52 +08:00
屈轩
9eec520567 fix(webconsole): use common options (#19330) 2024-01-29 11:29:29 +08:00
Zexi Li
56869281c4 Merge pull request #19364 from swordqiu/automated-cherry-pick-of-#19363-upstream-release-3.11
Automated cherry pick of #19363: fix: validate policy violation when assign users for oidc IDP
2024-01-28 21:58:50 +08:00
Qiu Jian
78123d0335 fix: validate policy violation when assign users for oidc IDP 2024-01-27 18:17:23 +08:00
Zexi Li
9442b445d0 fix(apigateway): ignore empty rows when registering baremetal host (#19354) 2024-01-27 18:16:42 +08:00
Zexi Li
08fdf688d4 fix(climc): wire is required when using network-create (#19360) 2024-01-27 18:05:21 +08:00
wanyaoqi
775d70be15 fix(host-deployer): escape back quote (#19356) 2024-01-27 08:09:59 +08:00
Zexi Li
ab29fa4c70 Merge pull request #19339 from swordqiu/automated-cherry-pick-of-#19338-upstream-release-3.11
Automated cherry pick of #19338: fix: not resolve local domain with dns records
2024-01-26 16:05:18 +08:00
Zexi Li
21876d631c Merge pull request #19347 from wanyaoqi/fix/host-deployer-disconnect
fix(host-deployer): check sshclient is nil on disconnect
2024-01-26 16:04:02 +08:00
wanyaoqi
ed2a412ed2 fix(host-deployer): check sshclient is nil on disconnect 2024-01-26 12:08:33 +08:00
屈轩
9c2dd4b0ea fix(region): sync resource owner with auto-create-project options (#19320) 2024-01-26 11:14:22 +08:00
Zexi Li
a605f69560 Merge pull request #19344 from zexi/automated-cherry-pick-of-#19342-upstream-release-3.11
Automated cherry pick of #19342: optimized(scheduler): remove fillResidentTenants function loading data from db
2024-01-25 17:10:57 +08:00
Zexi Li
c8aed17eb2 optimized(scheduler): remove fillResidentTenants function loading data from db 2024-01-25 17:07:05 +08:00
Zexi Li
6a708c2c6a Merge pull request #19335 from zexi/automated-cherry-pick-of-#19334-upstream-release-3.11
Automated cherry pick of #19334: fix(baremetal): hardcode h3c ipmi lan channel to 1
2024-01-25 15:49:51 +08:00
Qiu Jian
fb91b1e3eb fix: not resolve local domain with dns records 2024-01-25 15:40:08 +08:00
Jian Qiu
45ee4b1b89 fix: ipv6 secgroup support (#19337)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-01-25 13:25:42 +08:00
Zexi Li
22e7a3383a fix(baremetal): hardcode h3c ipmi lan channel to 1 2024-01-25 11:54:02 +08:00
屈轩
fdf0c40119 fix(region): gcp secrule update (#19324) 2024-01-24 17:17:01 +08:00
屈轩
af4c02c0f1 fix(climc): optimized storagecache cmd (#19322) 2024-01-24 15:03:26 +08:00
Zexi Li
e18ad59800 Merge pull request #19316 from zexi/automated-cherry-pick-of-#19314-upstream-release-3.11
Automated cherry pick of #19314: fix(build): use telegraf-raid-plugin:release-1.6.5
2024-01-22 16:59:30 +08:00
Zexi Li
3ad45a3cf9 fix(build): use telegraf-raid-plugin:release-1.6.5 2024-01-22 16:50:36 +08:00
Jian Qiu
6f22beca3c fix(region): server change config input recode (#19300)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-01-22 11:33:09 +08:00
屈轩
826532c5f9 fix(region): avoid panic (#19311) 2024-01-19 19:31:15 +08:00
屈轩
dc8c06a037 fix(region): auto encrypt options password (#19308) 2024-01-19 19:19:47 +08:00
屈轩
c0909bdd53 fix(region): vendor update for aws image import (#19306) 2024-01-19 16:14:39 +08:00
屈轩
0cafaf7445 fix(region): eip sync with project (#19302) 2024-01-19 14:04:19 +08:00
gouqi11
c132ae0cd6 feat(region): support notify for guest_status changed (#19298)
Co-authored-by: 马鸿飞 <mahongfei@yunion.cn>
2024-01-19 10:24:18 +08:00
gouqi11
bf6a035b53 feat(notify): SupportReceiverGetContactTypeByRoleId (#19296)
Co-authored-by: 马鸿飞 <mahongfei@yunion.cn>
2024-01-19 10:14:35 +08:00
屈轩
4187111862 fix(region): huawe redis spec code update (#19294) 2024-01-18 18:23:06 +08:00
屈轩
d01474470c fix(region): check kvm vpc and security group relation (#19292) 2024-01-18 14:34:56 +08:00
屈轩
36254142a9 fix(region): huawei bucket create with usable regions (#19290) 2024-01-18 11:19:38 +08:00
gouqi11
15425550ef fix(region): add public_cloud_provider list (#19287)
Co-authored-by: 马鸿飞 <mahongfei@yunion.cn>
2024-01-18 10:48:55 +08:00
Jian Qiu
cc1a5bcd2c fix: windows ipv6 support (#19280)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-01-17 19:47:34 +08:00
屈轩
e2e357f89c fix(climc): add bill report for volc account (#19284) 2024-01-17 14:51:16 +08:00
Jian Qiu
a42ce1792e fix: try resolve tenant by project id first (#19277)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-01-17 00:28:30 +08:00
Jian Qiu
8c50a52fe0 fix: automatically refresh invalid admin token (#19273)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-01-17 00:27:57 +08:00
Jian Qiu
72cd6e3e32 fix: dhcpv6 support in vpc network (#19271)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-01-17 00:27:36 +08:00
屈轩
c58a3fd48a fix(region): vendor update for pve vm sync (#19266) 2024-01-16 15:34:48 +08:00
屈轩
c1606f751d fix(region): esxi vm create with tags (#19263) 2024-01-16 14:25:54 +08:00
屈轩
8bea62e5b9 fix(region): dns record update with enabled params (#19261) 2024-01-15 19:47:24 +08:00
gouqi11
4b2509d72b feat(notify): support project notify (#19259)
Co-authored-by: 马鸿飞 <mahongfei@yunion.cn>
2024-01-15 19:35:07 +08:00
Zexi Li
e5829292e9 Merge pull request #19258 from ioito/automated-cherry-pick-of-#19257-upstream-release-3.11
Automated cherry pick of #19257: fix(region): vendor update for aliyun security group rule create
2024-01-15 19:21:56 +08:00
ioito
e8f3e390ba fix(region): vendor update for aliyun security group rule create 2024-01-15 19:12:14 +08:00
屈轩
cef7656187 fix(region): avoid duplicate cachedimage insert (#19255) 2024-01-15 18:30:44 +08:00
Jian Qiu
3c6da1faac Automated cherry pick of #19249: Feature/qj ipv6 support (#19253)
* feature: ipv6 support

* fix: ipv6 support more

* fix: update vendor for ipv6 support

* fix: allow enable ipv6 on existing guestnetwork

---------

Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-01-15 13:33:02 +08:00
wanyaoqi
3b313f11ab fix(host-deployer): add growpart resize partitions (#19251) 2024-01-15 12:14:41 +08:00
屈轩
3d703b9ed9 fix(region): huawei eip disassociate (#19244) 2024-01-12 19:32:08 +08:00
屈轩
05fda8da59 fix(region): avoid duplicate project create (#19241) 2024-01-12 19:16:17 +08:00
屈轩
27a9fab7cb fix(region): huawei disk refresh (#19238) 2024-01-12 15:53:29 +08:00
屈轩
d95380c6d1 fix(cloudmon): huawei metric pull (#19236) 2024-01-12 15:40:02 +08:00
屈轩
f543323b51 fix(region): vendor update for huawei rds create (#19232) 2024-01-11 19:04:18 +08:00
Jian Qiu
845123b1b0 fix: no fetch owner scope when GetProperty (#19230)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-01-11 18:58:52 +08:00
wanyaoqi
533b240a28 fix(host-deployer): add cmdline vsyscall=emulate on ramfs guest (#19223)
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:45:08 +08:00
Jian Qiu
416a26d12e fix: verbose api helper params (#19220)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-01-11 05:43:59 +08:00
wanyaoqi
53dc58dc69 feat(region,host): shared lvm storage (#19194) 2024-01-10 23:26:23 +08:00
Zexi Li
f40c4e0644 Merge pull request #19196 from wanyaoqi/fix/host-register-skip-virtual-functions
fix(host): host-agent register skip upload vf nics
2024-01-10 10:28:22 +08:00
Zexi Li
270c2ff5fd Merge pull request #19216 from wanyaoqi/automated-cherry-pick-of-#19215-upstream-release-3.11
Automated cherry pick of #19215: fix(host-deployer): deploy params has special char
2024-01-10 10:27:16 +08:00
Zexi Li
cff4a7adac Merge pull request #19214 from gouqi11/automated-cherry-pick-of-#19213-upstream-release-3.11
Automated cherry pick of #19213: fix(notify): fix host webhook err
2024-01-10 10:00:03 +08:00
wanyaoqi
7149904806 fix(host-deployer): deploy params has special char 2024-01-09 23:06:18 +08:00
马鸿飞
e941f84ce2 fix(notify): add actionTranslate 2024-01-09 19:23:50 +08:00
屈轩
8cf0b0e216 fix(region): skip sync used ip addr (#19208) 2024-01-09 17:50:29 +08:00
屈轩
9cce3064b3 fix(region): image project tags (#19211) 2024-01-09 17:49:58 +08:00
屈轩
3a9aab679e fix(region): avoid gcp secgroup delete failed (#19206) 2024-01-09 16:59:47 +08:00
屈轩
541464f035 fix(region): skip clear secgroup when delete vm (#19200) 2024-01-09 16:59:17 +08:00
wanyaoqi
abd0409f88 fix(host): host-agent register skip upload vf nics 2024-01-08 23:09:29 +08:00
屈轩
00283e54d2 fix(region): access group rule purge (#19192) 2024-01-08 15:52:24 +08:00
屈轩
28f58bca71 fix(region): simplify db init (#19183) 2024-01-08 14:19:17 +08:00
屈轩
449937a7ce fix(region): volcengine network range (#19188) 2024-01-08 11:35:08 +08:00
屈轩
a845b12294 fix(region): support aliyun essd entry (#19185) 2024-01-08 11:18:06 +08:00
屈轩
c958e588b9 fix(region): access group without cache (#19179) 2024-01-05 19:58:49 +08:00
gouqi11
d19cd2ab53 fix(notify): add missing topic (#19175)
Co-authored-by: 马鸿飞 <mahongfei@yunion.cn>
2024-01-05 18:57:34 +08:00
屈轩
4f3948b6e5 fix(region): vendor update for zstack secgroup rule (#19170) 2024-01-05 10:39:06 +08:00
Jian Qiu
c4ebe1d2e4 fix: vpc dhcp options string value should be double quoted (#19163)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-01-05 07:56:11 +08:00
gouqi11
4f6ffac66d fix(notify): host topic bug fix (#19168)
Co-authored-by: 马鸿飞 <mahongfei@yunion.cn>
2024-01-04 19:21:06 +08:00
屈轩
3b8549d8c7 fix(region): add translate (#19157) 2024-01-02 16:49:26 +08:00
wanyaoqi
bdd9953199 fix(host): host register set isinit false on hostId not null (#19154)
Signed-off-by: wanyaoqi <d3lx.yq@gmail.com>
2024-01-02 14:01:19 +08:00
Jian Qiu
9f40a68157 fix: qmp free port test (#19151)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2024-01-02 14:00:33 +08:00
wanyaoqi
486aa4edf4 fix(region): ovs offload interface get ifname from isolated devices tlb (#19146)
Signed-off-by: wanyaoqi <d3lx.yq@gmail.com>
2023-12-31 12:30:24 +08:00
Jian Qiu
5511fd7652 fix: automatically reserve guest gateway IP (#19143)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-12-30 17:11:40 +08:00
Jian Qiu
7e8d6ee4b0 fix: deploy user ssh keypair for user account only (#19134)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-12-30 16:56:36 +08:00
wanyaoqi
9f7f0f7caa feat(region,host,host-deployer): infiniband nic sriov support (#19127) 2023-12-30 16:55:56 +08:00
屈轩
28a25ebade fix(region): vendor update for huawei project sync (#19140) 2023-12-29 17:09:40 +08:00
Zexi Li
5593f125db Merge pull request #19130 from swordqiu/automated-cherry-pick-of-#19129-upstream-release-3.11
Automated cherry pick of #19129: fix: avoid megacli hang on adpallinfo
2023-12-29 16:37:06 +08:00
Qiu Jian
3f71995205 fix: avoid megacli hang on adpallinfo 2023-12-28 22:10:12 +08:00
gouqi11
c381cbde23 feat(notify): support notify for host (#19122)
Co-authored-by: 马鸿飞 <mahongfei@yunion.cn>
2023-12-27 20:07:32 +08:00
gouqi11
3a52563646 fix(monitor): fix alertRecord manager (#19117)
Co-authored-by: 马鸿飞 <mahongfei@yunion.cn>
2023-12-27 17:31:01 +08:00
屈轩
b8625cb2ab fix(region): huawei subaccount (#19118) 2023-12-27 14:20:42 +08:00
屈轩
182662d5d1 fix(region): vendor update for deploy vm struct params (#19114) 2023-12-27 11:33:37 +08:00
屈轩
b55a39cc84 fix(climc): support set tencent cloud bill report (#19108) 2023-12-27 11:07:41 +08:00
wanyaoqi
382d8f6f39 fix(region,host-deployer): qga os distribution format (#19109)
host-deployer fix xfs mount error

Signed-off-by: wanyaoqi <d3lx.yq@gmail.com>
2023-12-26 20:15:17 +08:00
Jian Qiu
0fa95647d5 fix: delete server will purge instance backups (#19103)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-12-26 15:45:00 +08:00
Jian Qiu
b4f6c11538 Automated cherry pick of #19095: Feature/qj support default interface (#19102)
* fix: support default gateway interface

* fix: default gateway 2

---------

Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-12-26 15:35:14 +08:00
wanyaoqi
aa210a77f6 feat(region,host): guest sync os info (#19099) 2023-12-26 12:49:24 +08:00
屈轩
0bfc248ecc fix(region): optimized host-list speed (#19094) 2023-12-26 11:04:15 +08:00
屈轩
a1ab937ef7 fix(region): esxi change config (#19090) 2023-12-25 14:36:26 +08:00
屈轩
8415fee8c4 fix(region): change storage_size from int to int64 (#19086) 2023-12-22 18:36:15 +08:00
Zexi Li
84d692dbad Merge pull request #19081 from ioito/automated-cherry-pick-of-#19080-upstream-release-3.11
Automated cherry pick of #19080: fix(region): avoid for-loop sync volcengine disks
2023-12-22 17:32:43 +08:00
Zexi Li
d839af0a58 Merge pull request #19083 from wanyaoqi/automated-cherry-pick-of-#19082-upstream-release-3.11
Automated cherry pick of #19082: fix(host-deployer): check executor is enabled on init qemu driver
2023-12-22 17:32:04 +08:00
wanyaoqi
97425a471a fix(host-deployer): check executor is enabled on init qemu driver 2023-12-22 17:19:53 +08:00
ioito
bb3f48a374 fix(region): avoid for-lool sync volcengine disks 2023-12-22 16:31:01 +08:00
屈轩
21132195a9 fix(region): optimized disk list (#19077) 2023-12-22 14:49:38 +08:00
屈轩
1c2e36a40b fix(region): add disk preallocation for guest info (#19075) 2023-12-22 10:36:02 +08:00
屈轩
c6401d7694 fix(region): remove debug sql query (#19073) 2023-12-21 20:50:42 +08:00
Zexi Li
e7f446047c feat(baremetal-agent): support using tftp to download kernel and initrd (#19065) 2023-12-21 00:50:58 +08:00
屈轩
7a922aeede fix(region): refactor huawei api for support organization (#19068) 2023-12-20 19:31:18 +08:00
Zexi Li
9b0648fca8 Merge pull request #19059 from swordqiu/automated-cherry-pick-of-#19057-upstream-release-3.11
Automated cherry pick of #19057: fix: webconsole ssh open forward failure
2023-12-20 11:37:52 +08:00
屈轩
62103bd7dd fix(region): vendor update for volcengine network and aws dnsrecords sync (#19062) 2023-12-20 11:35:11 +08:00
Qiu Jian
d37a437e0d fix: webconsole ssh open forward failure 2023-12-20 00:08:09 +08:00
屈轩
e11af2d012 fix(region): ignore empty certificate error for ssl sync (#19054) 2023-12-19 20:26:13 +08:00
Zexi Li
40681ccf44 Merge pull request #19052 from ioito/automated-cherry-pick-of-#19051-upstream-release-3.11
Automated cherry pick of #19051: fix(region): avoid rds vcpu count is zero
2023-12-19 14:25:56 +08:00
屈轩
8955cd8e1d fix(region): add log for skiped pending deleted vm (#19050) 2023-12-19 13:28:22 +08:00
ioito
a9285aff4b fix(region): avoid rds vcpu count is zero 2023-12-19 13:26:25 +08:00
Zexi Li
f5e837ec75 Merge pull request #19047 from zhasm/automated-cherry-pick-of-#19046-upstream-release-3.11
Automated cherry pick of #19046: fix(docker): update dockerfile for ansible-base
2023-12-19 13:17:01 +08:00
Zhang Dongliang
83d9774ed6 fix(docker): update dockerfile for ansible-base 2023-12-19 13:09:21 +08:00
屈轩
fc235cbb88 fix(region): snapshot policy sync external id (#19043) 2023-12-18 19:14:18 +08:00
Zexi Li
b288cda5c7 Merge pull request #19035 from swordqiu/automated-cherry-pick-of-#19033-upstream-release-3.11
Automated cherry pick of #19033: fix: disable pvpanic dev
2023-12-18 17:26:50 +08:00
Zexi Li
8b4d4bbb3a Merge pull request #19032 from wanyaoqi/automated-cherry-pick-of-#19031-upstream-release-3.11
Automated cherry pick of #19031: fix(host-deployer): pass config files to deploy vm
2023-12-18 17:25:17 +08:00
Zexi Li
c31d40d31e Merge pull request #19038 from wanyaoqi/automated-cherry-pick-of-#19037-upstream-release-3.11
Automated cherry pick of #19037: fix(host): usb device hotplug
2023-12-18 17:23:09 +08:00
wanyaoqi
20d18137a5 fix(host): hot add usb device 2023-12-18 17:06:18 +08:00
wanyaoqi
9ce5fa6290 fix(host): usb host device add device_id 2023-12-18 17:06:18 +08:00
Qiu Jian
5700b3555d fix: disable pvpanic dev 2023-12-18 16:45:04 +08:00
wanyaoqi
fd1910480e fix(host-deployer): pass config files to deploy vm 2023-12-18 16:42:46 +08:00
屈轩
727390d6d5 fix(region): The latest api of Huawei cloud elb and eip is applicable (#19028) 2023-12-18 15:41:26 +08:00
gouqi11
01f38f9f3e feat(region): add ip_addr for rds.GetShortDesc (#19022)
Co-authored-by: 马鸿飞 <mahongfei@yunion.cn>
2023-12-16 16:38:57 +08:00
屈轩
724fbac416 fix(region): do not clean up the running vm in the recycle bin (#19016) 2023-12-16 12:51:09 +08:00
Zexi Li
4823e1b471 Merge pull request #19013 from swordqiu/automated-cherry-pick-of-#19012-upstream-release-3.11
Automated cherry pick of #19012: fix: webconsole display information control
2023-12-16 10:10:39 +08:00
Zexi Li
004cedc130 Merge pull request #19010 from zexi/automated-cherry-pick-of-#19007-upstream-release-3.11
Automated cherry pick of #19007: fix(scheduler): reload cloudprovider's hosts when syncing finished
2023-12-16 10:06:09 +08:00
Qiu Jian
2292a08364 fix: webconsole display information control 2023-12-15 21:19:18 +08:00
Zexi Li
fff91b8eca fix(scheduler): reload cloudprovider's hosts when syncing finished 2023-12-15 20:19:32 +08:00
屈轩
644b2a20ab fix(region): refactor snapshot policy (#19006) 2023-12-15 17:08:01 +08:00
Zexi Li
0e5a31c41e fix(cloudcommon): service config informer doesn't start watching (#19004) 2023-12-15 14:58:48 +08:00
Zexi Li
7103249d75 Merge pull request #18998 from swordqiu/automated-cherry-pick-of-#18997-upstream-release-3.11
Automated cherry pick of #18997: fix: refine webconsole ssh api
2023-12-15 11:50:43 +08:00
Zexi Li
b9c7c59188 Merge pull request #19000 from wanyaoqi/automated-cherry-pick-of-#18999-upstream-release-3.11
Automated cherry pick of #18999: fix(host-deployer): udpate yunionos, reduce yunionos memsize
2023-12-15 11:50:14 +08:00
wanyaoqi
746a96722c fix(host-deployer): udpate yunionos, reduce yunionos memsize 2023-12-15 11:41:11 +08:00
Qiu Jian
b66c3efd27 fix: refine webconsole ssh api 2023-12-15 10:40:27 +08:00
屈轩
ec08fce85a fix(region): remove useless snapshot policy code (#18993) 2023-12-14 11:56:12 +08:00
屈轩
ef5fee6c8b fix(region): avoid duplicate rule name for gcp (#18990) 2023-12-14 11:23:38 +08:00
wanyaoqi
1f25fc17b8 feat(region,host): clvm support (#18978) 2023-12-14 09:41:54 +08:00
Zexi Li
d811d64fce Merge pull request #18986 from swordqiu/automated-cherry-pick-of-#18985-upstream-release-3.11
Automated cherry pick of #18985: fix: backup storage capacity_mb field optional
2023-12-14 03:28:21 +08:00
屈轩
c19596176c fix(region): set status available for kvm secgroup rule after created (#18988) 2023-12-13 21:26:29 +08:00
Qiu Jian
f7db51b504 fix: backup storage capacity_mb field optional 2023-12-13 19:52:39 +08:00
Zexi Li
f4d9166c79 Merge pull request #18981 from zexi/monitor-vm-measurements
fix(monitor): fetch measurements from victoriametrics
2023-12-13 19:47:15 +08:00
Zexi Li
aef50a49a6 fix(monitor): fetch measurements from victoriametrics 2023-12-13 18:49:40 +08:00
Zexi Li
a5f2194afc Merge pull request #18977 from zexi/automated-cherry-pick-of-#18975-upstream-release-3.11
Automated cherry pick of #18975: fix(monitor): consider whether the target host is in source host of mem balancer
2023-12-13 13:38:28 +08:00
Zexi Li
796bea5d7c fix(monitor): consider whether the target host is in source host of mem balancer 2023-12-13 12:54:37 +08:00
Zexi Li
d2bf8c44ad Merge pull request #18970 from ioito/automated-cherry-pick-of-#18969-upstream-release-3.11
Automated cherry pick of #18969: fix(region): vendor update for gcp rebuild-root sys disk size and password login
2023-12-12 18:21:15 +08:00
ioito
3258a85236 fix(region): vendor update for gcp rebuild-root sys disk size and password login 2023-12-12 17:23:52 +08:00
Zexi Li
ee102ca0c6 Merge pull request #18966 from wanyaoqi/automated-cherry-pick-of-#18965-upstream-release-3.11
Automated cherry pick of #18965: fix(host-deployer): run guest on host and ignore no config file
2023-12-12 15:18:59 +08:00
wanyaoqi
afd5a1f716 fix(host-deployer): run guest on host and ignore no config file
Signed-off-by: wanyaoqi <d3lx.yq@gmail.com>
2023-12-12 14:56:03 +08:00
Zexi Li
34a1f623ef Merge pull request #18952 from swordqiu/automated-cherry-pick-of-#18951-upstream-release-3.11
Automated cherry pick of #18951: fix: ignore vm virtual ip changes
2023-12-12 09:34:27 +08:00
Zexi Li
4e8cea612a Merge pull request #18955 from swordqiu/hotfix/qj-more-verbose-metric-collection
fix: log metric collection action
2023-12-11 16:18:29 +08:00
Qiu Jian
e9cea00f2d fix: log metric collection action 2023-12-11 00:28:44 +08:00
Qiu Jian
b81d367f95 fix: ignore vm virtual ip changes 2023-12-10 13:28:26 +08:00
Jian Qiu
91ced9d0f4 fix: host add a local config file (#18933)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-12-08 21:26:40 +08:00
屈轩
22b68fe2d4 fix(region): support volc balance and gcp api retry (#18947) 2023-12-08 17:56:42 +08:00
屈轩
d0e8273b51 fix(region): optimized sync code (#18944) 2023-12-08 15:06:47 +08:00
Zexi Li
4959215d7a Merge pull request #18939 from zexi/monitor-domain-no-metrics
fix(monitor): not add scope to query resource from region service
2023-12-08 12:41:51 +08:00
Zexi Li
cc1c57155c fix(monitor): not add scope to query resource from region service 2023-12-08 12:28:20 +08:00
Zexi Li
5d886e304d Merge pull request #18928 from swordqiu/automated-cherry-pick-of-#18927-upstream-release-3.11
Automated cherry pick of #18927: fix: no default fallback dns server
2023-12-08 10:47:06 +08:00
Zexi Li
100f41bdd9 Merge pull request #18926 from zexi/climc-monitor-query
feat(monitor): make simple-query API adapting victoriametrics and add monitor-unifiedmonitor-query command
2023-12-08 10:46:11 +08:00
Zexi Li
590cba97bb feat(climc): add monitor-unifiedmonitor-query command 2023-12-08 10:05:02 +08:00
Qiu Jian
a8f985a188 fix: no default fallback dns server 2023-12-08 01:16:18 +08:00
Zexi Li
8eaa742333 fix(monitor): make simple-query API adapt to victoriametrics 2023-12-08 00:31:22 +08:00
Zexi Li
ed990bd55f Merge pull request #18923 from ioito/automated-cherry-pick-of-#18922-upstream-release-3.11
Automated cherry pick of #18922: fix(region): cloudpods uefi and generate name
2023-12-07 16:41:07 +08:00
Zexi Li
837c29e34f Merge pull request #18917 from wanyaoqi/automated-cherry-pick-of-#18916-upstream-release-3.11
Automated cherry pick of #18916: Fix/host deployer
2023-12-07 16:40:18 +08:00
ioito
7cadeea34f fix(region): cloudpods uefi and generate name 2023-12-07 16:15:02 +08:00
wanyaoqi
9da12b090a fix(host-deployer): disconnect fix and concurrence control 2023-12-07 16:05:21 +08:00
屈轩
5ae6751ad3 fix(webconsole): rdp 用户隔离上传文件 (#18921) 2023-12-07 15:22:14 +08:00
屈轩
1570a14746 feat(webconsole): support sftp for ssh (#18919) 2023-12-07 14:54:19 +08:00
wanyaoqi
8bfb666129 fix:(host-deployer): arm guest add gic version 2023-12-07 10:37:11 +08:00
屈轩
df3571f972 fix: guacd docker file mkdir required dir (#18913) 2023-12-06 17:03:40 +08:00
Zexi Li
0060fce771 Merge pull request #18909 from zexi/automated-cherry-pick-of-#18908-upstream-release-3.11
Automated cherry pick of #18908: fix(monitor): map interval to step
2023-12-06 16:16:23 +08:00
Zexi Li
db7808a683 Merge pull request #18908 from zexi/vm-map
fix(monitor): map interval to step
2023-12-06 16:16:08 +08:00
Zexi Li
4cbd9fcdfd fix(monitor): map interval to step 2023-12-06 15:32:40 +08:00
Jian Qiu
fb86463bbf fix: esxi hotadd cpu limit (#18893)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-12-06 15:31:15 +08:00
Zexi Li
887132e297 fix(monitor): map interval to step 2023-12-06 15:31:08 +08:00
屈轩
370c405684 fix(keystone): remove deleted project metadata (#18906) 2023-12-06 15:29:51 +08:00
屈轩
92c23a245b fix(webconsole): optimized guacd error log (#18904) 2023-12-06 11:59:49 +08:00
Zexi Li
bd54efcd2e Merge pull request #18897 from zexi/monitor-vm-top
fix(monitor): update vendor to support victoriametrics topk func
2023-12-05 18:23:19 +08:00
Zexi Li
f212295104 fix(monitor): update vendor to support victoriametrics topk func 2023-12-05 18:01:36 +08:00
Jian Qiu
bc5982907e fix: add index for token_cache_tbl to accelerate invalid token query (#18890)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-12-05 12:22:27 +08:00
Jian Qiu
01e764e62e fix: clickhouse mapping table use the same name as origin (#18888)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-12-05 12:22:02 +08:00
Zexi Li
5698d47252 Merge pull request #18881 from ioito/automated-cherry-pick-of-#18880-upstream-release-3.11
Automated cherry pick of #18880: fix(region): avoid cloudmon no cloudprovider sync
2023-12-05 12:06:58 +08:00
Zexi Li
3ec0372159 Merge pull request #18883 from ioito/automated-cherry-pick-of-#18882-upstream-release-3.11
Automated cherry pick of #18882: fix: show update oc cmd
2023-12-05 12:06:25 +08:00
ioito
76b81e33d4 fix: show update oc cmd 2023-12-05 10:40:18 +08:00
ioito
19378997ee fix(region): avoid cloudmon no cloudprovider sync 2023-12-05 10:05:50 +08:00
Jian Qiu
b20ec7bdb3 fix: mapping mysql tables into clickhouse with Engine MySQL (#18878)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-12-05 07:08:29 +08:00
wanyaoqi
32f2bc5821 fix(host-deployer): qemu deployer without kvm support (#18874) 2023-12-05 07:07:11 +08:00
wanyaoqi
ffafcdb7c1 fix(region): add option control enable default dns server (#18872) 2023-12-04 17:02:14 +08:00
Zexi Li
7a87d00304 Merge pull request #18868 from ioito/automated-cherry-pick-of-#18867-upstream-release-3.11
Automated cherry pick of #18867: fix(region): vendor update
2023-12-04 15:25:58 +08:00
ioito
d6fd14c39a fix(region): vendor update 2023-12-04 14:59:37 +08:00
Zexi Li
f65d175990 Merge pull request #18864 from wanyaoqi/automated-cherry-pick-of-#18863-upstream-release-3.11
Automated cherry pick of #18863: fix(host-deployer,host): mv deploy driver option to common options
2023-12-04 14:35:21 +08:00
屈轩
3bc094e9d7 fix(region): vendor update (#18861) 2023-12-04 14:26:18 +08:00
wanyaoqi
45bec04fde fix(host-deployer,host): mv deploy driver option to common options 2023-12-04 14:22:17 +08:00
Zexi Li
973ef23b42 Merge pull request #18857 from wanyaoqi/fix/qemu-deploy-guest-3-11
Manual cherrypick of #18856
2023-12-04 10:35:28 +08:00
wanyaoqi
4c9e7e1ddd fix(host-deployer): update base image and fix return errors 2023-12-04 01:49:15 +08:00
Jian Qiu
673d67f586 fix: reserve ping probed ip with expiration (#18855)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-12-03 22:27:26 +08:00
Jian Qiu
f243c3d66f fix: force assign ip address when sync vm vnics (#18853)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-12-03 15:34:36 +08:00
Zexi Li
c31ace6222 fix(baremetal): disable probe access mac by redfish driver (#18846) 2023-12-03 15:17:51 +08:00
Zexi Li
e17ace8c64 Merge pull request #18845 from zexi/automated-cherry-pick-of-#18843-upstream-release-3.11
Automated cherry pick of #18843: feat(ci): use github action to check PR
2023-12-01 14:58:54 +08:00
Zexi Li
9079f4c8bb feat(ci): use github action to check PR 2023-12-01 14:54:55 +08:00
Jian Qiu
f4e0db5c11 fix: server create instance backup parameters (#18842)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-11-30 20:19:17 +08:00
屈轩
fe78f19e14 fix(region): 增加配置项,支持标签不再同步至云上功能 (#18838) 2023-11-30 19:12:52 +08:00
屈轩
e333fb6f36 fix(webconsole): rdp stop (#18841) 2023-11-30 19:12:29 +08:00
Jian Qiu
3739da2114 Automated cherry pick of #18831: Hotfix/qj esxi sync ips support (#18836)
* fix: support esxi subips

* update vendor

---------

Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-11-30 18:04:12 +08:00
wanyaoqi
7bc08d6dfe fix(host): guest switch to backup (#18834) 2023-11-30 17:14:56 +08:00
wanyaoqi
5aeb7eabcb Automated cherry pick of #18821: Feat/deploy guest (#18822)
* 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:50:08 +08:00
屈轩
1647a7dd00 fix(region): optional vcpu when change vm config (#18826) 2023-11-30 13:33:42 +08:00
屈轩
d259d7adc9 fix(region): skip sync meta if no public cloud register (#18828) 2023-11-30 13:33:16 +08:00
Jian Qiu
a76d8fc4f3 fix: filter networks by host type (#18819)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-11-30 00:07:49 +08:00
屈轩
13d26f7b43 fix(webconsole): checke rdp password (#18817) 2023-11-29 19:07:43 +08:00
屈轩
362e5467c8 fix(webconsole): rdp enable drive (#18806) 2023-11-29 19:07:10 +08:00
屈轩
8472fe65b6 fix(region): vendor update (#18815) 2023-11-29 15:00:41 +08:00
屈轩
0b8c6a0255 fix(region): 只读账号增量更新标签 (#18812) 2023-11-29 14:53:46 +08:00
Jian Qiu
75435de8a8 fix: generalized metadata getter (#18808)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-11-29 09:04:21 +08:00
屈轩
a3270d53e9 feat(webconsole): support rdp (#18803) 2023-11-28 10:47:14 +08:00
Zexi Li
dc7a451a4d Merge pull request #18801 from swordqiu/automated-cherry-pick-of-#18800-upstream-release-3.11
Automated cherry pick of #18800: fix: customized show content of get-property
2023-11-28 10:09:34 +08:00
Qiu Jian
12aaad6cd9 fix: customized show content of get-property 2023-11-28 09:13:32 +08:00
Zexi Li
22b098b4a2 Merge pull request #18797 from zexi/nvidia-gpu-metrics
fix(monitor): register agent_nvidia_smi metrics
2023-11-27 19:32:12 +08:00
Zexi Li
731af95698 fix(monitor): register agent_nvidia_smi metrics 2023-11-27 19:11:06 +08:00
Zexi Li
32a7f70edd Merge pull request #18792 from wanyaoqi/automated-cherry-pick-of-#18791-upstream-release-3.11
Automated cherry pick of #18791: fix(region): alloc ovn_mapped_ip_addr on host post create
2023-11-27 19:07:42 +08:00
Zexi Li
9e42caa08b Merge pull request #18788 from swordqiu/automated-cherry-pick-of-#18787-upstream-release-3.11
Automated cherry pick of #18787: fix: cloud account update aliyun billing scope
2023-11-27 19:06:47 +08:00
屈轩
98e818b182 fix(region): revert os dist filter and sort (#18794) 2023-11-27 17:34:40 +08:00
wanyaoqi
3aa27eaad5 fix(region): alloc ovn_mapped_ip_addr on host post create 2023-11-27 17:19:44 +08:00
Qiu Jian
283a6fa5aa fix: cloud account update aliyun billing scope 2023-11-27 01:26:10 +08:00
Zexi Li
3a9b11c57d Merge pull request #18784 from swordqiu/feature/qj-backup-support-object-storage
feature: backup support object storage
2023-11-26 20:56:16 +08:00
Qiu Jian
2dec7a3726 fix: encrypt object storage secret 2023-11-26 19:53:57 +08:00
Qiu Jian
f8284d8bc1 fix: update model api 2023-11-26 16:55:42 +08:00
Qiu Jian
20167c2afd feature: backup support object storage 2023-11-26 16:01:46 +08:00
Zexi Li
8adf5abf86 feat(host): use IsolatedDeviceModels as GPU whitelist (#18783) 2023-11-25 19:41:05 +08:00
Zexi Li
06dc39a591 feat(host): use IsolatedDeviceModels as GPU whitelist (#18780) 2023-11-25 19:40:53 +08:00
屈轩
6bef6a1cb6 fix(region): trim metadata key (#18776) 2023-11-24 22:17:47 +08:00
屈轩
04c6ee73a8 fix(region): vm filter by os dist (#18778) 2023-11-24 20:06:05 +08:00
屈轩
f7c83468ea fix(region): distinct os dist field (#18768) 2023-11-24 11:51:55 +08:00
屈轩
39f3c7a1e4 fix(region): show guest gpu model (#18766) 2023-11-23 12:39:47 +08:00
Jian Qiu
7fd56f1baa fix: hot add mem check for esxi vm (#18763)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-11-23 12:20:52 +08:00
Zexi Li
c6f6329bcd Merge pull request #18760 from swordqiu/automated-cherry-pick-of-#18757-upstream-release-3.11
Automated cherry pick of #18757: fix: hot add mem check for esxi vm
2023-11-23 10:15:29 +08:00
Qiu Jian
fef1b4a578 fix: hot add mem check for esxi vm 2023-11-23 09:54:08 +08:00
Zexi Li
c309fdd3c1 feat(region): add nvidia_smi telegraf input plugin (#18751) 2023-11-23 00:19:40 +08:00
屈轩
7504c2eb5b fix(keystone): project clean (#18742) 2023-11-21 21:10:23 +08:00
Zexi Li
ffb8ff3df8 Merge pull request #18746 from zexi/monitor-vm-mul-query
fix(monitor): query multiple fileds from victoria-metrics
2023-11-21 18:05:47 +08:00
Zexi Li
ece44e0698 fix(monitor): query multiple fileds from victoria-metrics 2023-11-21 17:44:22 +08:00
Zexi Li
d0f045b65f Merge pull request #18744 from ioito/automated-cherry-pick-of-#18743-upstream-release-3.11
Automated cherry pick of #18743: fix(region): remove useless filter params
2023-11-21 17:16:45 +08:00
ioito
bd7319daf7 fix(region): remove useless filter params 2023-11-21 16:05:53 +08:00
屈轩
7461a25508 fix(region): cpu socket (#18732) 2023-11-21 15:08:36 +08:00
Zexi Li
16d6212c45 Merge pull request #18736 from zexi/srv-hardware-info
feat(region,host,climc): aggregate server hardware information
2023-11-21 14:08:56 +08:00
Zexi Li
8fb19b87d2 feat(region,host,climc): aggregate server hardware information 2023-11-21 12:00:19 +08:00
gouqi11
c763fc68dc feat(common): log support rebilling (#18738)
Co-authored-by: 马鸿飞 <mahongfei@yunion.cn>
2023-11-20 19:21:10 +08:00
屈轩
46b435ca5b fix(region): vendor update for aliyun tags (#18728) 2023-11-17 16:30:25 +08:00
gouqi11
cd9ee7bc9a fix(notify): fix webhook brand (#18724)
Co-authored-by: 马鸿飞 <mahongfei@yunion.cn>
2023-11-17 15:37:21 +08:00
屈轩
acac041bec fix(region): redis cloudregion id (#18722) 2023-11-17 15:19:53 +08:00
Zexi Li
950a02183b Merge pull request #18720 from zexi/automated-cherry-pick-of-#18718-upstream-release-3.11
Automated cherry pick of #18718: fix(climc): bash completion is not working
2023-11-17 12:34:01 +08:00
Zexi Li
440a7fa5fc fix(climc): bash completion is not working 2023-11-17 12:03:27 +08:00
屈轩
1abb1086ed fix(region): vendor update (#18715) 2023-11-17 11:34:28 +08:00
屈轩
4c84f1cbe1 fix(region): vendor update (#18712) 2023-11-17 10:08:47 +08:00
gouqi11
28644d3da4 Automated cherry pick of #18704: fix(region): rds skip notImplementedErr (#18710)
* fix(region): rds skip notImplementedErr

* fix(region): aws redis set metadata status

---------

Co-authored-by: 马鸿飞 <mahongfei@yunion.cn>
2023-11-16 17:20:45 +08:00
屈轩
5bf44a67ac fix(region): vendor update (#18707) 2023-11-16 17:17:40 +08:00
gouqi11
340f458ff4 update vendor (#18702)
Co-authored-by: 马鸿飞 <mahongfei@yunion.cn>
2023-11-16 10:01:00 +08:00
gouqi11
89efdbc642 fix(region): fix db_dispatcher duplicate notify (#18699)
Co-authored-by: 马鸿飞 <mahongfei@yunion.cn>
2023-11-15 17:02:43 +08:00
Jian Qiu
885f4ebcd8 fix: update lb cluster with patch params (#18696)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-11-15 08:57:28 +08:00
Jian Qiu
7783546754 fix: windows GPU vm should set hypervisor=off (#18691)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-11-15 08:56:43 +08:00
Jian Qiu
b3580ab64f fix: make host dhcp lease options global (#18683)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-11-15 08:55:14 +08:00
Jian Qiu
a757ea3dd8 fix: host set nil metadata (#18688)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-11-15 08:54:34 +08:00
Jian Qiu
b2b60ff660 fix: organization node weight not effective (#18694)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-11-15 08:54:08 +08:00
Zexi Li
30ee89a390 feat(region,climc): add set-os-info api (#18680) 2023-11-14 22:59:56 +08:00
Zexi Li
9706339eac Merge pull request #18670 from wanyaoqi/automated-cherry-pick-of-#18669-upstream-release-3.11
Automated cherry pick of #18669: fix(host): sync sriov nic bw on change config
2023-11-14 20:25:31 +08:00
屈轩
aa6e34e98d feat(region): support oracle cloud (#18679) 2023-11-14 19:43:29 +08:00
gouqi11
e99c7bed63 Automated cherry pick of #18663: fix(keystone): fix usage for projectNum (#18664)
* feat(region): support action to reBilling

* fix(keystone): fix keystone usage for projectNum

---------

Co-authored-by: 马鸿飞 <mahongfei@yunion.cn>
2023-11-14 19:32:22 +08:00
Zexi Li
c810a3b144 fix(host): setup routes from start to end (#18674) 2023-11-14 17:56:11 +08:00
wanyaoqi
77ff5fcd44 fix(host): sync sriov nic bw on change config 2023-11-14 16:31:11 +08:00
Zexi Li
64027a3280 Merge pull request #18666 from wanyaoqi/automated-cherry-pick-of-#18665-upstream-release-3.11
Automated cherry pick of #18665: fix(regin): instance snapshot create guest fill os arch
2023-11-14 14:47:48 +08:00
Zexi Li
8606e6cfbd Merge pull request #18662 from ioito/automated-cherry-pick-of-#18661-upstream-release-3.11
Automated cherry pick of #18661: fix(region): order by os dist
2023-11-14 14:44:54 +08:00
wanyaoqi
0ad56aa42f fix(regin): instance snapshot create guest fill os arch 2023-11-14 11:16:46 +08:00
ioito
4c2d42a79f fix(region): order by os dist 2023-11-14 10:47:11 +08:00
Zexi Li
9b8094c9a5 Merge pull request #18656 from zexi/automated-cherry-pick-of-#18655-upstream-release-3.11
Automated cherry pick of #18655: fix(host): catch init error
2023-11-13 21:12:38 +08:00
Zexi Li
7702776d8f Merge pull request #18658 from zexi/automated-cherry-pick-of-#18634-upstream-release-3.11
Automated cherry pick of #18634: chore: unnecessary use of fmt.Sprintf d
2023-11-13 20:44:49 +08:00
guoguangwu
65d66edbc7 chore: unnecessary use of fmt.Sprintf d
Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
2023-11-13 20:42:42 +08:00
Zexi Li
b3180bd87a fix(host): catch init error 2023-11-13 20:40:12 +08:00
Zexi Li
aad04d9cdc Merge pull request #18645 from swordqiu/automated-cherry-pick-of-#18644-upstream-release-3.11
Automated cherry pick of #18644: fix: extend gpu pci class codes
2023-11-13 19:19:38 +08:00
屈轩
845eecc217 fix(yunionconf): allow disable bug report (#18654) 2023-11-13 19:03:58 +08:00
屈轩
59f5c5beea fix(region): vm gpu notes (#18652) 2023-11-13 18:15:40 +08:00
屈轩
1a2c830a76 fix(region): esxi support preallocation vdisk (#18648) 2023-11-13 18:15:18 +08:00
Zexi Li
55707f159a Merge pull request #18640 from wanyaoqi/automated-cherry-pick-of-#18639-upstream-release-3.11
Automated cherry pick of #18639: fix(region,host): sriov nic hotplug and metrics fix
2023-11-13 17:02:35 +08:00
Zexi Li
a6928cfa67 Merge pull request #18635 from ioito/automated-cherry-pick-of-#18633-upstream-release-3.11
Automated cherry pick of #18633: fix(region): esxi disk storage
2023-11-13 16:58:53 +08:00
Qiu Jian
d9e8372d90 fix: extend gpu pci class codes 2023-11-13 16:21:26 +08:00
wanyaoqi
550bfc53b4 fix(region,host): sriov nic hotplug and metrics fix 2023-11-13 14:40:28 +08:00
Zexi Li
6ee1dbedb0 Merge pull request #18637 from wanyaoqi/automated-cherry-pick-of-#18636-upstream-release-3.11
Automated cherry pick of #18636: fix(region): change config check traffic limit params
2023-11-13 11:38:43 +08:00
wanyaoqi
2de131eb27 fix(region): change config check traffic limit params 2023-11-13 11:21:47 +08:00
ioito
c43f0cedf6 fix(region): esxi disk storage 2023-11-13 10:49:36 +08:00
Zexi Li
5183678684 Merge pull request #18632 from ioito/automated-cherry-pick-of-#18631-upstream-release-3.11
Automated cherry pick of #18631: fix(cloudmon): collect metric with project tags
2023-11-10 16:45:40 +08:00
Zexi Li
08288b2d75 Merge pull request #18627 from swordqiu/automated-cherry-pick-of-#18625-upstream-release-3.11
Automated cherry pick of #18625: fix: cloudprovider external id
2023-11-10 16:40:21 +08:00
ioito
de19868d32 fix(cloudmon): collect metric with project tags 2023-11-10 16:33:28 +08:00
屈轩
6a7c109c83 fix(region): vendor update (#18630) 2023-11-10 16:09:56 +08:00
Zexi Li
cacb1e3c6f Merge pull request #18616 from zexi/automated-cherry-pick-of-#18545-upstream-release-3.11
Automated cherry pick of #18545: feat(monitor,region,host,cloudmon): support VictoriaMetrics as TSDB backend
2023-11-10 16:05:34 +08:00
屈轩
54ec8acbeb fix(common): support report bug (#18628) 2023-11-10 15:46:22 +08:00
Zexi Li
4f96f2e5fa feat(monitor,region,host,cloudmon): support VictoriaMetrics as TSDB backend 2023-11-10 15:34:01 +08:00
Qiu Jian
889e9577ef fix: cloudprovider external id 2023-11-10 12:07:55 +08:00
屈轩
698937280a fix(region): vendor update (#18623) 2023-11-10 11:59:09 +08:00
屈轩
bac8ecf432 fix(region): qcloud secgroup rule priority (#18621) 2023-11-10 11:54:59 +08:00
Zexi Li
853855d174 Merge pull request #18619 from gouqi11/automated-cherry-pick-of-#18618-upstream-release-3.11
Automated cherry pick of #18618: fix(keystone): fix usage empty projectTags
2023-11-09 16:09:52 +08:00
马鸿飞
0450883be1 fix(keystone): fix usage empty projectTags 2023-11-09 15:32:15 +08:00
Zexi Li
b6247630f9 Merge pull request #18614 from ioito/automated-cherry-pick-of-#18613-upstream-release-3.11
Automated cherry pick of #18613: fix(region): pve cdrom with host info
2023-11-09 12:18:18 +08:00
ioito
4c8fd267a8 fix(region): pve cdrom with host info 2023-11-09 12:05:01 +08:00
屈轩
82be65ecaf fix(region): avoid panic when sync aliyun redis (#18607) 2023-11-08 20:56:31 +08:00
gouqi11
ffcc092089 feat(usage): support project count (#18611)
Co-authored-by: 马鸿飞 <mahongfei@yunion.cn>
2023-11-08 20:36:49 +08:00
屈轩
7ca7bf48ab fix(webconsole): pve vnc support (#18604) 2023-11-08 19:35:11 +08:00
Zexi Li
fc4cc7d0b1 fix(host): ignore error when add bridge ip address route (#18601) 2023-11-08 17:39:45 +08:00
屈轩
0fd0284051 fix(region): clean invalid skus (#18595) 2023-11-07 21:16:51 +08:00
屈轩
5b930df74f fix(region): vendor update (#18591) 2023-11-07 20:37:03 +08:00
Zexi Li
c0db929d4c Merge pull request #18585 from wanyaoqi/automated-cherry-pick-of-#18584-upstream-release-3.11
Automated cherry pick of #18584: fix(host-deployer): use sync.lock on nbd connect/disconnect
2023-11-07 15:40:19 +08:00
wanyaoqi
3f74e94e8f fix(host-deployer): use sync.lock on nbd connect/disconnect 2023-11-07 15:30:20 +08:00
wanyaoqi
2ea7da3746 Automated cherry pick of #18580: fix(host): sync guest machine type on live migrate (#18581)
* fix(host): sync guest machine type on live migrate

* fix(host): checkout real anonymous pci devs on ensure pci address
2023-11-07 09:45:40 +08:00
wanyaoqi
1e196b1a9d fix(host-deployer): detach nbd device do not block main thread (#18577) 2023-11-07 07:22:13 +08:00
Zexi Li
07b6906d30 Merge pull request #18572 from wanyaoqi/automated-cherry-pick-of-#18571-upstream-release-3.11
Automated cherry pick of #18571: fix(host): live migrate ensure disk storate type
2023-11-06 16:47:58 +08:00
wanyaoqi
1b6c3aa20a fix(host): live migrate ensure disk storate type 2023-11-06 14:43:55 +08:00
Zexi Li
1a1d941d30 Merge pull request #18566 from swordqiu/automated-cherry-pick-of-#18565-upstream-release-3.11
Automated cherry pick of #18565: fix: qemu disk set serial as disk_id
2023-11-05 11:44:53 +08:00
Qiu Jian
9ff75d4656 fix: qemu disk set serial as disk_id 2023-11-04 18:50:03 +08:00
Zexi Li
181c99868e Merge pull request #18560 from swordqiu/automated-cherry-pick-of-#18559-upstream-release-3.11
Automated cherry pick of #18559: fix: host fail to migrate interface routes
2023-11-04 18:28:14 +08:00
Qiu Jian
634e52142a fix: host fail to migrate interface routes 2023-11-03 23:58:30 +08:00
屈轩
af80f0d82c fix(region): volcengine monitor (#18558) 2023-11-03 13:56:46 +08:00
wanyaoqi
eaa5c52456 fix(region,host): support traffic limit in change config (#18554) 2023-11-03 10:10:25 +08:00
Zexi Li
f7a17d64d6 Merge pull request #18550 from ioito/automated-cherry-pick-of-#18549-upstream-release-3.11
Automated cherry pick of #18549: fix(region): esxi vm resize disk online
2023-11-02 15:02:22 +08:00
Zexi Li
422ae1e511 Merge pull request #18547 from wanyaoqi/automated-cherry-pick-of-#18546-upstream-release-3.11
Automated cherry pick of #18546: fix(host-deployer): clean nbd mount on host-deployer start
2023-11-02 15:01:22 +08:00
ioito
4e44ae2932 fix(region): esxi vm resize disk online 2023-11-02 11:24:08 +08:00
wanyaoqi
38e11808df fix(host-deployer): clean nbd mount on host-deployer start 2023-11-01 21:25:41 +08:00
屈轩
c9d20e7a14 fix(region): volc bucket storage class (#18544) 2023-11-01 20:02:16 +08:00
屈轩
8282619b86 fix(region): vendor update (#18541) 2023-11-01 19:13:40 +08:00
屈轩
4178d46cd9 fix(region): vendor update (#18539) 2023-11-01 18:52:08 +08:00
屈轩
be5075a74b fix(region): vendor update (#18535) 2023-11-01 17:48:09 +08:00
gouqi11
b9aadb704d update vendor (#18533)
Co-authored-by: 马鸿飞 <mahongfei@yunion.cn>
2023-11-01 15:41:46 +08:00
Zexi Li
0a78de3166 Merge pull request #18530 from wanyaoqi/automated-cherry-pick-of-#18529-upstream-release-3.11
Automated cherry pick of #18529: fix(host): live migrate pass disk num queues
2023-11-01 14:58:13 +08:00
wanyaoqi
a84676af7c fix(host): live migrate pass disk num queues 2023-11-01 14:48:24 +08:00
Zexi Li
84c1c7d8d4 Merge pull request #18525 from ioito/automated-cherry-pick-of-#18524-upstream-release-3.11
Automated cherry pick of #18524: fix(region): skip vm eip not found error log
2023-11-01 10:13:46 +08:00
Zexi Li
858af35887 Merge pull request #18523 from ioito/automated-cherry-pick-of-#18522-upstream-release-3.11
Automated cherry pick of #18522: fix(region): volcengine vm save image
2023-11-01 10:13:01 +08:00
Jian Qiu
ddc2b319ed fix: xfs zerofree (experimental) (#18527)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-11-01 09:41:18 +08:00
ioito
d6b28d270f fix(region): skip vm eip not found error log 2023-10-31 20:43:18 +08:00
ioito
49c813659b fix(region): volcengine vm save image 2023-10-31 20:40:47 +08:00
屈轩
9d0e545c66 fix(region): vendor update (#18514) 2023-10-31 20:24:09 +08:00
Zexi Li
2f7c4cd671 Merge pull request #18516 from wanyaoqi/automated-cherry-pick-of-#18515-upstream-release-3.11
Automated cherry pick of #18515: fix(host): detect blk dev numqueues and nics(no id) pci addresses
2023-10-31 20:17:40 +08:00
Zexi Li
08dd95748c Merge pull request #18519 from wanyaoqi/automated-cherry-pick-of-#18518-upstream-release-3.11
Automated cherry pick of #18518: fix(region): reduce local disk max size to 10T
2023-10-31 19:51:14 +08:00
wanyaoqi
9b1622325f fix(region): reduce local disk max size to 10T 2023-10-31 19:38:09 +08:00
Zexi Li
5480dfd1c8 Merge pull request #18504 from swordqiu/automated-cherry-pick-of-#18503-upstream-release-3.11
Automated cherry pick of #18503: fix: dhcp hostname not compatible with some os
2023-10-31 19:28:49 +08:00
Zexi Li
da3167d3bc Merge pull request #18499 from zexi/automated-cherry-pick-of-#18497-upstream-release-3.11
Automated cherry pick of #18497: feat(apigateway): report running env
2023-10-31 19:28:06 +08:00
Zexi Li
c5923cc4b9 Merge pull request #18512 from gouqi11/automated-cherry-pick-of-#18511-upstream-release-3.11
Automated cherry pick of #18511: fix(scheduledtask): supportCycleType week and month
2023-10-31 19:27:33 +08:00
wanyaoqi
732d70d6e5 fix(host): detect blk dev numqueues and nics(no id) pci addresses 2023-10-31 19:17:18 +08:00
屈轩
d33e1f6371 fix(keystone): validate time_zone input (#18506) 2023-10-31 18:41:26 +08:00
马鸿飞
8fddf20c68 fix(scheduledtask): supportCycleType week and month 2023-10-31 17:44:31 +08:00
Qiu Jian
9e2e2d6b8d fix: dhcp hostname not compatible with some os 2023-10-31 12:02:53 +08:00
Zexi Li
304e520ce6 Merge pull request #18495 from ioito/automated-cherry-pick-of-#18494-upstream-release-3.11
Automated cherry pick of #18494: fix(region): vendor update
2023-10-30 20:39:37 +08:00
Zexi Li
c895e5bc7c Merge pull request #18479 from swordqiu/automated-cherry-pick-of-#18478-upstream-release-3.11
Automated cherry pick of #18478: fix: scheduler ping/pong response mime
2023-10-30 20:37:25 +08:00
Zexi Li
c24b0a4082 feat(apigateway): report running env 2023-10-30 20:32:54 +08:00
ioito
f4b74c790c fix(region): vendor update 2023-10-30 20:09:47 +08:00
屈轩
30f2fda002 fix(region): vendor update (#18493) 2023-10-30 17:03:39 +08:00
屈轩
097237eb8c fix(region): qcloud security group rule priority (#18489) 2023-10-30 17:03:17 +08:00
屈轩
69e8ab1936 fix(region): avoid hostname has '-' suffix (#18486) 2023-10-30 17:02:32 +08:00
屈轩
0f8443905a fix(region): gpu spec (#18483) 2023-10-30 14:39:09 +08:00
屈轩
f58532081e fix(region): kvm secgroup filter (#18477) 2023-10-30 13:55:25 +08:00
Qiu Jian
335ff385c5 fix: scheduler ping/pong response mime 2023-10-30 13:17:09 +08:00
Zexi Li
99563805ec Merge pull request #18457 from ioito/automated-cherry-pick-of-#18456-upstream-release-3.11
Automated cherry pick of #18456: fix(region): add gpu log
2023-10-30 10:05:08 +08:00
Zexi Li
03b9501ccb Merge pull request #18473 from ioito/automated-cherry-pick-of-#18472-upstream-release-3.11
Automated cherry pick of #18472: fix(region): security group rule priority validate
2023-10-30 10:03:33 +08:00
Zexi Li
06f3ca8588 Merge pull request #18475 from wanyaoqi/automated-cherry-pick-of-#17671-upstream-release-3.11
Automated cherry pick of #17671: feat(region): add guest rescue api
2023-10-30 10:02:12 +08:00
boironic@gmail.com
7f0fdc3739 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-10-29 20:56:26 +08:00
屈轩
6fb42c4d2c fix(region): kvm server cnt (#18470) 2023-10-27 19:39:18 +08:00
ioito
3b98af9628 fix(region): security group rule priority validate 2023-10-27 19:35:54 +08:00
屈轩
3364a94082 fix(region): vendor update (#18467) 2023-10-27 16:40:50 +08:00
屈轩
0b3ae628c4 fix(region): vendor update (#18465) 2023-10-27 16:08:04 +08:00
屈轩
eb7eb8795b fix(region): aliyun cloud_auto enable burst (#18461) 2023-10-27 15:18:41 +08:00
Zexi Li
9064790c84 Merge pull request #18443 from swordqiu/automated-cherry-pick-of-#18442-upstream-release-3.11
Automated cherry pick of #18442: fix: support rocky linux guestfs
2023-10-27 10:04:14 +08:00
Zexi Li
af70eec115 Merge pull request #18449 from ioito/automated-cherry-pick-of-#18448-upstream-release-3.11
Automated cherry pick of #18448: fix(region): 避免esxi vm没有被真正删除
2023-10-27 10:03:05 +08:00
屈轩
7a6a962790 fix(region): remove useless code (#18455) 2023-10-26 18:35:07 +08:00
ioito
fc8c45e2de fix(region): add gpu log 2023-10-26 18:03:57 +08:00
屈轩
d867fd0251 fix(region): security group rule update (#18452) 2023-10-26 17:58:03 +08:00
ioito
fb911b41ab fix(region): 避免esxi vm没有被真正删除 2023-10-26 14:48:22 +08:00
Zexi Li
756fd92a27 Merge pull request #18446 from ioito/automated-cherry-pick-of-#18445-upstream-release-3.11
Automated cherry pick of #18445: fix(region): fix #18397 esxi vm set tags
2023-10-26 12:11:46 +08:00
ioito
a3b080334c fix(region): fix #18397 esxi vm set tags 2023-10-26 11:41:29 +08:00
屈轩
f03617c18f fix(region): vendor update (#18441) 2023-10-26 11:23:29 +08:00
Qiu Jian
f547d6bc47 fix: support rocky linux guestfs 2023-10-26 11:20:35 +08:00
Zexi Li
c1d148d4e3 Merge pull request #18417 from swordqiu/automated-cherry-pick-of-#18416-upstream-release-3.11
Automated cherry pick of #18416: fix: auto sync esxi host status periodically
2023-10-26 10:08:49 +08:00
Zexi Li
ecc63f3501 Merge pull request #18436 from wanyaoqi/automated-cherry-pick-of-#18435-upstream-release-3.11
Automated cherry pick of #18435: Fix/misc fix 20231025
2023-10-26 10:07:58 +08:00
Zexi Li
9ce1f2322c Merge pull request #18438 from ioito/automated-cherry-pick-of-#18434-upstream-release-3.11
Automated cherry pick of #18434: Hotfix/qx clean scheduler
2023-10-26 10:06:25 +08:00
ioito
f0ac779e55 fix(region): 避免频繁清理调度器缓存 2023-10-26 09:55:03 +08:00
wanyaoqi
835bdf2c15 fix(region): guest start check vcpu is enough 2023-10-25 23:55:26 +08:00
wanyaoqi
0508225799 fix(host): skip isolated device probe on kvm not support 2023-10-25 23:54:42 +08:00
wanyaoqi
069a9a8eaf fix(region): rebuild root update guest bios 2023-10-25 23:54:42 +08:00
屈轩
14300e2f91 fix(region): fix cloudaccount sync projectMapping (#18432)
Co-authored-by: 马鸿飞 <mahongfei@yunion.cn>
2023-10-25 20:53:47 +08:00
gouqi11
204a059cae feat(cloudmon): support lbMetric for MetricTypeDriver (#18430)
Co-authored-by: 马鸿飞 <mahongfei@yunion.cn>
2023-10-25 20:38:02 +08:00
屈轩
675468f48c fix(region): vendor update (#18429) 2023-10-25 19:24:42 +08:00
屈轩
6476cea4dc fix(region): vendor update (#18426) 2023-10-25 18:24:53 +08:00
屈轩
860109369d fix(region): secgroup rule fix (#18415) 2023-10-25 17:58:13 +08:00
Zexi Li
82f1952842 Merge pull request #18419 from wanyaoqi/automated-cherry-pick-of-#18418-upstream-release-3.11
Automated cherry pick of #18418: fix(host): live migrate misc fix
2023-10-25 10:20:48 +08:00
wanyaoqi
601d539bba fix(host): live migrate misc fix 2023-10-25 01:59:01 +08:00
Qiu Jian
e89c3a78da fix: auto sync esxi host status periodically 2023-10-24 21:50:44 +08:00
Zexi Li
80b4caeeda feat(climc): always try to print id and name firstly (#18412) 2023-10-24 21:48:35 +08:00
Zexi Li
f1394bed02 feat(climc): always try to print id and name firstly (#18410) 2023-10-24 21:48:26 +08:00
屈轩
f4d34c8ee4 Revert "fix(common): remove service default policy (#18312)" (#18413)
This reverts commit 6ff9e75fb1.
2023-10-24 21:47:50 +08:00
Zexi Li
e2fb312311 Merge pull request #18386 from swordqiu/automated-cherry-pick-of-#18385-upstream-release-3.11
Automated cherry pick of #18385: fix: capabilities brand revisit
2023-10-24 20:01:47 +08:00
Zexi Li
e2af2f2602 Merge pull request #18409 from ioito/automated-cherry-pick-of-#18408-upstream-release-3.11
Automated cherry pick of #18408: fix(region): kube cluster brand
2023-10-24 19:50:14 +08:00
ioito
6fadaec519 fix(region): kube cluster brand 2023-10-24 18:50:26 +08:00
Zexi Li
30746be01e Merge pull request #18407 from gouqi11/automated-cherry-pick-of-#18396-upstream-release-3.11
Automated cherry pick of #18396: feat(notify): Allow direct notification sending
2023-10-24 15:39:00 +08:00
马鸿飞
b0ccc84260 feat(notify): Allow direct notification sending 2023-10-24 15:24:42 +08:00
Zexi Li
b7db6d4535 Merge pull request #18404 from zexi/automated-cherry-pick-of-#18403-upstream-release-3.11
Automated cherry pick of #18403: fix(scheduler): fetch host storages directly
2023-10-24 14:37:28 +08:00
Zexi Li
bdaf659a28 fix(scheduler): fetch host storages directly 2023-10-24 14:26:49 +08:00
Zexi Li
6583094e85 Merge pull request #18401 from ioito/automated-cherry-pick-of-#18400-upstream-release-3.11
Automated cherry pick of #18400: fix(region): aws eip not found error
2023-10-24 14:23:37 +08:00
ioito
631c255970 fix(region): aws eip not found error 2023-10-24 13:25:30 +08:00
Zexi Li
51f5b01c4e Merge pull request #18394 from wanyaoqi/automated-cherry-pick-of-#18393-upstream-release-3.11
Automated cherry pick of #18393: fix(host-deployer): deploy qga conf according hypervisor
2023-10-23 11:43:27 +08:00
Zexi Li
51ab18e0ba Merge pull request #18384 from wanyaoqi/automated-cherry-pick-of-#18383-upstream-release-3.11
Automated cherry pick of #18383: fix(region,host): live migrate disk driver determines the migration mode
2023-10-23 11:18:03 +08:00
Zexi Li
e0ab303771 Merge pull request #18390 from ioito/automated-cherry-pick-of-#18389-upstream-release-3.11
Automated cherry pick of #18389: fix(apigateway): baremetal usage
2023-10-23 11:17:15 +08:00
wanyaoqi
e8f4e85943 fix(host-deployer): deploy qga conf according hypervisor 2023-10-23 10:48:10 +08:00
ioito
6bf139297c fix(apigateway): baremetal usage 2023-10-23 10:38:14 +08:00
Zexi Li
6e679a88be Merge pull request #18356 from gouqi11/automated-cherry-pick-of-#18161-upstream-release-3.11
Automated cherry pick of #18161: feat(scheduledTask): support cycle_hour
2023-10-23 10:17:33 +08:00
Qiu Jian
e2a843f018 fix: capabilities brand revisit 2023-10-23 10:16:32 +08:00
wanyaoqi
679ddfa3d0 fix(region,host): live migrate disk driver determines the migration mode 2023-10-23 10:12:21 +08:00
马鸿飞
50bd35b558 feat(scheduledTask): support cycle_hour 2023-10-23 10:07:05 +08:00
Jian Qiu
675d453f02 fix: vpcagent sync error (#18382)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-10-23 09:27:32 +08:00
wanyaoqi
f5b1c828f1 feat(region,host): cloudpods guest convert to kvm guest (#18378) 2023-10-23 09:25:51 +08:00
Zexi Li
e97408dca8 fix(scheduler): improve scheduler prefer and avoid tags strategy (#18373) 2023-10-20 20:46:14 +08:00
Zexi Li
8a89981f79 Merge pull request #18366 from swordqiu/automated-cherry-pick-of-#18365-upstream-release-3.11
Automated cherry pick of #18365: fix: auto convert missing subformat images
2023-10-20 12:28:28 +08:00
Zexi Li
5215a7baff Merge pull request #18363 from swordqiu/automated-cherry-pick-of-#18362-upstream-release-3.11
Automated cherry pick of #18362: fix: fail to fetch admin ssh keypair
2023-10-20 10:35:18 +08:00
Qiu Jian
dd2a61e9a6 fix: auto convert missing subformat images 2023-10-20 10:23:51 +08:00
Qiu Jian
b394e58ee4 fix: fail to fetch admin ssh keypair 2023-10-20 05:42:05 +08:00
Zexi Li
7e7b6512f4 Merge pull request #18361 from ioito/automated-cherry-pick-of-#18360-upstream-release-3.11
Automated cherry pick of #18360: fix(region): aws lb sync panic
2023-10-19 20:34:13 +08:00
ioito
b7ec468b03 fix(region): aws lb sync panic 2023-10-19 20:15:21 +08:00
Jian Qiu
b6e1e9d226 fix: allow vmware network associate with multiple wires (#18341)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-10-19 09:15:40 +08:00
wanyaoqi
64310bf4df fix(host-deployer): change netdev prefix to "en" on nics has different driver (#18330)
Signed-off-by: wanyaoqi <d3lx.yq@gmail.com>
2023-10-18 20:40:46 +08:00
Jian Qiu
99f671d567 fix: missing project mapping body (#18353)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-10-18 20:39:38 +08:00
屈轩
d5a3913a1f fix: docgengo (#18351) 2023-10-18 06:19:10 -05:00
屈轩
a6bab03c85 feature: add support for for VolcEngine (#18349)
Co-authored-by: kongrui <kongr@lamda.nju.edu.cn>
2023-10-18 06:05:41 -05:00
Zexi Li
2e761505bf Merge pull request #18343 from swordqiu/automated-cherry-pick-of-#18342-upstream-release-3.11
Automated cherry pick of #18342: fix: unable to recognize anolis os
2023-10-18 15:00:30 +08:00
屈轩
ca89d83e4f fix(climc): 避免climc交互模式下--help自动退出 (#18339) 2023-10-17 20:58:49 -05:00
Qiu Jian
aafab22bb7 fix: unable to recognize anolis os 2023-10-18 01:54:29 +08:00
屈轩
6d49f8c5c8 fix(region): standardization stage name (#18300) 2023-10-18 01:26:36 +08:00
Zexi Li
c59daea668 Merge pull request #18323 from gouqi11/automated-cherry-pick-of-#18320-upstream-release-3.11
Automated cherry pick of #18320: fix(notify): fix role subscriber groupTimes
2023-10-17 12:24:11 +08:00
Zexi Li
dd151944ca Merge pull request #18326 from wanyaoqi/automated-cherry-pick-of-#18325-upstream-release-3.11
Automated cherry pick of #18325: fix(scheduler): isolated device predicate miss sriov nic
2023-10-17 11:51:10 +08:00
wanyaoqi
0fa98f7b82 fix(scheduler): isolated device predicate miss sriov nic 2023-10-16 16:22:19 +08:00
马鸿飞
99afc444a7 fix(notify): fix role subscriber groupTimes 2023-10-16 15:59:33 +08:00
屈轩
847459f2a8 fix(common): distinguish system and user log by is_system_account (#18317) 2023-10-15 20:58:09 -05:00
屈轩
6ff9e75fb1 fix(common): remove service default policy (#18312) 2023-10-13 14:00:39 +08:00
屈轩
115eb587e3 fix(region): show network details with dns (#18289) 2023-10-13 07:43:42 +08:00
屈轩
1b74a9c6a0 fix(keystone): policy result (#18285) 2023-10-13 07:41:12 +08:00
Jian Qiu
b4b9485068 fix: update vendor for edito retry (#18309)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-10-13 07:29:04 +08:00
Jian Qiu
4e9957c3f2 fix: climc server-logininfo action (#18296)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-10-12 20:19:02 +08:00
屈轩
afc77d0c7b fix(region): classify invalid access key error (#18305) 2023-10-12 20:17:49 +08:00
屈轩
05ab9311b3 fix(region): avoid ctyun signature verification failed (#18302) 2023-10-12 19:08:39 +08:00
屈轩
0809d6ecfa fix(region): remove ctyun useless env paramenter (#18293) 2023-10-12 18:06:12 +08:00
屈轩
d97ec1c7b5 fix(region): aws userdata error fix (#18290) 2023-10-12 17:27:31 +08:00
Jian Qiu
2a5ba4d77f fix: update vendor 20231012 for sqlchemy (#18282)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-10-12 16:56:59 +08:00
屈轩
8bd9b78e21 fix(region): history usage (#18260) 2023-10-12 16:30:59 +08:00
Zexi Li
7c836a4993 Merge pull request #18279 from gouqi11/automated-cherry-pick-of-#18267-upstream-release-3.11
Automated cherry pick of #18267: feat(notify): support db_dispatcher notify
2023-10-12 15:51:13 +08:00
马鸿飞
7423ca9726 feat(notify): support db_dispatcher notify 2023-10-12 15:39:54 +08:00
Zexi Li
a1e77ea061 Merge pull request #18276 from ioito/automated-cherry-pick-of-#18275-upstream-release-3.11
Automated cherry pick of #18275: fix(region): use project sshkeypair to ssh vm
2023-10-12 14:59:45 +08:00
wanyaoqi
accc92da16 fix(host): check qga connect is closed (#18272) 2023-10-12 14:49:02 +08:00
ioito
0d85f41098 fix(region): use project sshkeypair to ssh vm 2023-10-12 14:24:02 +08:00
Zexi Li
2881f82226 Merge pull request #18265 from ioito/automated-cherry-pick-of-#18264-upstream-release-3.11
Automated cherry pick of #18264: fix(region): dns record cname check
2023-10-11 18:09:26 +08:00
Zexi Li
2b33c44d59 Merge pull request #18254 from zexi/server-ip-regexp-list
feat(region): filter server ip_addrs by REGEXP
2023-10-11 17:19:24 +08:00
屈轩
b32444047d fix(region): wait vm deleted (#18262) 2023-10-11 17:19:15 +08:00
ioito
560444bc25 fix(region): dns record cname check 2023-10-11 17:12:30 +08:00
Zexi Li
0c0bc34e67 Merge pull request #18251 from swordqiu/automated-cherry-pick-of-#18250-upstream-release-3.11
Automated cherry pick of #18250: fix: guest start params revisit
2023-10-11 17:11:06 +08:00
Zexi Li
7104d73ba6 feat(region): filter server ip_addrs by REGEXP 2023-10-11 17:03:16 +08:00
屈轩
ff414105cb fix: vendor update (#18258) 2023-10-11 16:22:28 +08:00
Qiu Jian
02db6f01e7 fix: guest start params revisit 2023-10-11 05:43:57 +08:00
Zexi Li
ca2ebb35f4 Merge pull request #18249 from zexi/automated-cherry-pick-of-#18246-upstream-release-3.11
Automated cherry pick of #18246: fix(monitor): select host that isn't in source hosts as target
2023-10-10 20:04:19 +08:00
Zexi Li
b21702417a fix(monitor): select host that isn't in source hosts as target 2023-10-10 20:03:55 +08:00
Jian Qiu
83d02d2bf0 fix: allow specify desktop linux os that not allow root login (#18244)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-10-09 18:38:07 +08:00
wanyaoqi
17733cdd80 fix(host): host sysinfo metadata double quota (#18240) 2023-10-09 18:36:40 +08:00
Zexi Li
37f2bc3fef Merge pull request #18236 from wanyaoqi/automated-cherry-pick-of-#18235-upstream-release-3.11
Automated cherry pick of #18235: fix(host-deployer): deploy qga conf ensure /etc/sysconfig dir
2023-10-09 14:56:30 +08:00
Jian Qiu
c00028ccc6 fix: handle old style auth token (#18233)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-10-09 12:30:28 +08:00
wanyaoqi
45b744bc50 fix(host-deployer): deploy qga conf ensure /etc/sysconfig dir 2023-10-09 12:23:21 +08:00
Jian Qiu
638c5130c6 fix: unauthorized error should return 401 (#18230)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-10-08 21:54:21 +08:00
Jian Qiu
5d59e54085 fix: missing invalid token response (#18227)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-10-08 18:27:38 +08:00
Jian Qiu
e319338460 fix: shorten keystone token (#18223)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-10-08 11:20:35 +08:00
Zexi Li
f5d466e359 Merge pull request #18220 from gouqi11/automated-cherry-pick-of-#18219-upstream-release-3.11
Automated cherry pick of #18219: feat: support policy and cors for bucket
2023-10-07 17:56:29 +08:00
马鸿飞
5bfa0e03ee feat: support policy and cors for bucket 2023-10-07 17:51:20 +08:00
Zexi Li
27b6f8b8d6 Merge pull request #18211 from ioito/automated-cherry-pick-of-#18210-upstream-release-3.11
Automated cherry pick of #18210: fix(region): vendor update
2023-10-07 13:18:13 +08:00
Zexi Li
27bbc9512f Merge pull request #18208 from wanyaoqi/automated-cherry-pick-of-#18207-upstream-release-3.11
Automated cherry pick of #18207: feat(region,glance): from cloudaccount to enable vmdk target format
2023-10-07 13:16:01 +08:00
ioito
90566723a2 fix(region): vendor update 2023-10-07 10:58:18 +08:00
wanyaoqi
23a7b8f15f feat(region,glance): from cloudaccount to enable vmdk target format 2023-10-07 09:59:39 +08:00
Jian Qiu
8f4fe468ec fix: async refresh revoked tokens (#18205)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-10-06 13:45:18 +08:00
Zexi Li
c3d782c358 Merge pull request #18200 from swordqiu/automated-cherry-pick-of-#18199-upstream-release-3.11
Automated cherry pick of #18199: feature: invalidate auth token
2023-10-05 19:22:21 +08:00
Qiu Jian
9f7458b58f feature: invalidate auth token 2023-10-05 03:41:15 +08:00
Zexi Li
c811818017 Merge pull request #18190 from swordqiu/automated-cherry-pick-of-#18183-upstream-release-3.11
Automated cherry pick of #18183: feature: SUSE guest support
2023-10-04 00:38:13 +08:00
Qiu Jian
1d1d93858a feature: SUSE guest support 2023-10-02 00:34:19 +08:00
Jian Qiu
a2b17a5492 fix: rebuild root support deploy params (#18188)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-10-02 00:16:17 +08:00
Jian Qiu
16d380813d fix: host nics api (#18185)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-10-01 23:40:34 +08:00
Jian Qiu
7e44c015b3 fix: add apis for logininfo (#18181)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2023-10-01 23:39:58 +08:00
Zexi Li
5b066bfd8c Merge pull request #18163 from swordqiu/automated-cherry-pick-of-#18162-upstream-release-3.11
Automated cherry pick of #18162: fix: fail purge disk due to getMastHost failure
2023-09-27 22:52:30 +08:00
Zexi Li
28d541ba78 Merge pull request #18169 from zexi/automated-cherry-pick-of-#18167-upstream-release-3.11
Automated cherry pick of #18167: fix(scheduler): some joint resources are not synced
2023-09-27 22:51:42 +08:00
Zexi Li
f27087867a Merge pull request #18171 from zexi/automated-cherry-pick-of-#18072-upstream-release-3.11
Automated cherry pick of #18072: fix(climc): delete the backup machine from the offline host
2023-09-27 17:10:52 +08:00
hoganlxj
f24cf2fdb0 Update clean_host.sh 2023-09-27 17:09:04 +08:00
Zexi Li
7735720a5e fix(scheduler): some joint resources are not synced 2023-09-27 16:47:36 +08:00
Qiu Jian
e8a52c23be fix: fail purge disk due to getMastHost failure 2023-09-27 14:32:42 +08:00
屈轩
710905c1f2 fix(region): change project log detail (#18154) 2023-09-26 17:58:53 +08:00
Zexi Li
475e698227 Merge pull request #18157 from wanyaoqi/automated-cherry-pick-of-#18156-upstream-release-3.11
Automated cherry pick of #18156: fix(region): remove ansible restart network on guest sync
2023-09-26 17:42:56 +08:00
wanyaoqi
ea3e855655 fix(region): remove ansible restart network on guest sync 2023-09-26 15:47:19 +08:00
Zexi Li
76bd871ef8 Merge pull request #18151 from zexi/automated-cherry-pick-of-#18124-upstream-release-3.11
Automated cherry pick of #18124: fix: charset mismatch in tenant cache convert_ids
2023-09-25 16:58:33 +08:00
Qiu Jian
b6446c8007 fix: charset mismatch in tenant cache convert_ids 2023-09-25 16:58:12 +08:00
Zexi Li
bd3c32b3a3 Merge pull request #18150 from zexi/automated-cherry-pick-of-#18126-upstream-release-3.11
Automated cherry pick of #18126: fix(region): hide agent status
2023-09-25 16:56:53 +08:00
Zexi Li
27b0b342b4 fix(region): hide agent status 2023-09-25 16:56:09 +08:00
Zexi Li
ef52ad5f25 Merge pull request #18146 from ioito/automated-cherry-pick-of-#18145-upstream-release-3.11
Automated cherry pick of #18145: fix(region): aliyun health check tls error
2023-09-25 16:53:49 +08:00
屈轩
efdb5beb71 fix(region): avoid panic after created vm (#18142) 2023-09-25 15:12:43 +08:00
ioito
7de4c55dfc fix(region): aliyun health check tls error 2023-09-25 15:11:10 +08:00
Zexi Li
6ee8be68cd Merge pull request #18137 from ioito/automated-cherry-pick-of-#18136-upstream-release-3.11
Automated cherry pick of #18136: fix(region): account ctx unlock
2023-09-22 16:49:54 +08:00
Zexi Li
f59d2bd256 Merge pull request #18115 from ioito/automated-cherry-pick-of-#18114-upstream-release-3.11
Automated cherry pick of #18114: fix(region): network update detail error
2023-09-22 16:48:33 +08:00
ioito
1f6f9d6adc fix(region): account ctx unlock 2023-09-22 16:22:39 +08:00
屈轩
bac4faf202 fix(region): aws disk type (#18133) 2023-09-22 14:17:31 +08:00
ioito
c2546c31a7 fix(region): network update detail error 2023-09-22 10:11:06 +08:00
Zexi Li
ea50886aa1 Merge pull request #18097 from wanyaoqi/automated-cherry-pick-of-#18096-upstream-release-3.11
Automated cherry pick of #18096: Fix/backup guest prelaunch
2023-09-21 22:43:58 +08:00
Zexi Li
1cf6a5d9db Merge pull request #18092 from wanyaoqi/automated-cherry-pick-of-#18091-upstream-release-3.11
Automated cherry pick of #18091: fix(host): insert iso name not correct
2023-09-21 22:42:04 +08:00
Zexi Li
6cb3a055ae Merge pull request #18081 from wanyaoqi/automated-cherry-pick-of-#18080-upstream-release-3.11
Automated cherry pick of #18080: Fix/host delete validate
2023-09-21 22:41:26 +08:00
Zexi Li
a5b782fdeb Merge pull request #18067 from wanyaoqi/automated-cherry-pick-of-#18065-upstream-release-3.11
Automated cherry pick of #18065: fix(region,host): cancel migrate sync guest status
2023-09-21 22:40:37 +08:00
Zexi Li
9d94a7355d Merge pull request #18077 from wanyaoqi/automated-cherry-pick-of-#18076-upstream-release-3.11
Automated cherry pick of #18076: fix(region,host): guest save image restart not work
2023-09-21 22:39:18 +08:00
Zexi Li
4cb465ab35 Merge pull request #18088 from wanyaoqi/automated-cherry-pick-of-#17858-upstream-release-3.11
Automated cherry pick of #17858: feat(region,host,host-deployer): add qga set network
2023-09-21 20:57:02 +08:00
Zexi Li
00a1659ce8 Merge pull request #18074 from wanyaoqi/automated-cherry-pick-of-#18073-upstream-release-3.11
Automated cherry pick of #18073: feat(region): host list filter by host storage type
2023-09-21 20:54:54 +08:00
屈轩
3d329d7412 fix(esxi-agent): vmware hostname (#18122) 2023-09-21 20:50:24 +08:00
屈轩
7c62173d3f fix(region): cloudpods userdata (#18118) 2023-09-21 20:49:32 +08:00
屈轩
3c14711346 fix(region): avoid deadlock for delete account (#18100) 2023-09-21 14:56:30 +08:00
屈轩
a8ba3a4ec5 fix(region): fix #18106 remove change chonfig stop charing restrict (#18108) 2023-09-21 14:55:23 +08:00
屈轩
3daf38b6a0 fix(region): guest vnc error (#18103) 2023-09-21 14:54:40 +08:00
屈轩
fcc5b2eae1 fix(region): server sku cpu arch filter (#18111) 2023-09-21 14:53:07 +08:00
wanyaoqi
9d7a49ebdf fix(host): avoid panic on host record not init 2023-09-21 11:04:39 +08:00
wanyaoqi
3d1507b0e4 fix(host): cancel backup guest prelaunch 2023-09-21 11:04:39 +08:00
wanyaoqi
e5be78e740 fix(host): insert iso name not correct 2023-09-20 21:24:56 +08:00
屈轩
22d0608786 fix(region): kube cluster version (#18084) 2023-09-20 20:18:16 +08:00
屈轩
2e74e42bde fix(region): vendor update (#18087) 2023-09-20 20:17:24 +08:00
chentianxiang
260a9cbe87 feat(region,host,host-deployer):use qga set network 2023-09-20 20:07:24 +08:00
wanyaoqi
1f4079a863 fix(region): validate is reserve all cpus 2023-09-20 19:41:04 +08:00
wanyaoqi
53d4b0c1b7 fix(region): host delete validate backup guests 2023-09-20 19:41:04 +08:00
wanyaoqi
a538e215b8 fix(region,host): guest save image restart not work 2023-09-20 19:37:25 +08:00
wanyaoqi
00a1ddc508 feat(region): host list filter by host storage type 2023-09-20 19:34:30 +08:00
wanyaoqi
a49148c7e4 fix(region,host): cancel migrate sync guest status 2023-09-20 00:21:02 +08:00
1948 changed files with 129488 additions and 55342 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

@@ -282,7 +282,7 @@ dep:
@echo "$$depDeprecated"
@$(MAKE) mod
RELEASE_BRANCH:=master
RELEASE_BRANCH:=release/3.11
GOPROXY ?= direct
mod:
@@ -349,7 +349,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

@@ -47,6 +47,11 @@ do
climc server-purge $i > /dev/null
done
for i in $(climc server-list --admin --limit 2048 --system --filter "backup_host_id.equals($HOSTID)" | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $2}')
do
climc server-delete-backup $i > /dev/null
done
echo "3. Clean disks on $HOSTNAME($HOSTID)"
for storageid in $(climc host-storage-list --host $HOSTID --show-emulated | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $4}')

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

@@ -0,0 +1,214 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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.
#
#
# Dockerfile for guacamole-server
#
# The Alpine Linux image that should be used as the basis for the guacd image
ARG ALPINE_BASE_IMAGE=latest
FROM alpine:${ALPINE_BASE_IMAGE} AS builder
ARG TARGETPLATFORM
RUN sed -i 's!https://dl-cdn.alpinelinux.org/!https://mirrors.ustc.edu.cn/!g' /etc/apk/repositories
# Install build dependencies
RUN apk add --no-cache \
autoconf \
automake \
build-base \
cairo-dev \
cmake \
cunit-dev \
git \
grep \
libjpeg-turbo-dev \
libpng-dev \
libtool \
libwebp-dev \
make \
openssl1.1-compat-dev \
pango-dev \
pulseaudio-dev \
util-linux-dev
# Copy source to container for sake of build
ARG BUILD_DIR=/tmp/guacamole-server
ARG GUAC_VER=1.5.3
RUN git clone --branch=${GUAC_VER} https://github.com/apache/guacamole-server.git /tmp/guacamole-server
#
# Base directory for installed build artifacts.
#
# NOTE: Due to limitations of the Docker image build process, this value is
# duplicated in an ARG in the second stage of the build.
#
ARG PREFIX_DIR=/opt/guacamole
#
# Automatically select the latest versions of each core protocol support
# library (these can be overridden at build time if a specific version is
# needed)
#
ARG WITH_FREERDP='2(\.\d+)+'
ARG WITH_LIBSSH2='libssh2-\d+(\.\d+)+'
ARG WITH_LIBTELNET='\d+(\.\d+)+'
ARG WITH_LIBVNCCLIENT='LibVNCServer-\d+(\.\d+)+'
ARG WITH_LIBWEBSOCKETS='v\d+(\.\d+)+'
#
# Default build options for each core protocol support library, as well as
# guacamole-server itself (these can be overridden at build time if different
# options are needed)
#
ARG FREERDP_OPTS="\
-DBUILTIN_CHANNELS=OFF \
-DCHANNEL_URBDRC=OFF \
-DWITH_ALSA=OFF \
-DWITH_CAIRO=ON \
-DWITH_CHANNELS=ON \
-DWITH_CLIENT=ON \
-DWITH_CUPS=OFF \
-DWITH_DIRECTFB=OFF \
-DWITH_FFMPEG=OFF \
-DWITH_GSM=OFF \
-DWITH_GSSAPI=OFF \
-DWITH_IPP=OFF \
-DWITH_JPEG=ON \
-DWITH_LIBSYSTEMD=OFF \
-DWITH_MANPAGES=OFF \
-DWITH_OPENH264=OFF \
-DWITH_OPENSSL=ON \
-DWITH_OSS=OFF \
-DWITH_PCSC=OFF \
-DWITH_PULSE=OFF \
-DWITH_SERVER=OFF \
-DWITH_SERVER_INTERFACE=OFF \
-DWITH_SHADOW_MAC=OFF \
-DWITH_SHADOW_X11=OFF \
-DWITH_SSE2=ON \
-DWITH_WAYLAND=OFF \
-DWITH_X11=OFF \
-DWITH_X264=OFF \
-DWITH_XCURSOR=ON \
-DWITH_XEXT=ON \
-DWITH_XI=OFF \
-DWITH_XINERAMA=OFF \
-DWITH_XKBFILE=ON \
-DWITH_XRENDER=OFF \
-DWITH_XTEST=OFF \
-DWITH_XV=OFF \
-DWITH_ZLIB=ON"
ARG GUACAMOLE_SERVER_OPTS="\
--disable-guaclog"
ARG LIBSSH2_OPTS="\
-DBUILD_EXAMPLES=OFF \
-DBUILD_SHARED_LIBS=ON"
ARG LIBTELNET_OPTS="\
--disable-static \
--disable-util"
ARG LIBVNCCLIENT_OPTS=""
ARG LIBWEBSOCKETS_OPTS="\
-DDISABLE_WERROR=ON \
-DLWS_WITHOUT_SERVER=ON \
-DLWS_WITHOUT_TESTAPPS=ON \
-DLWS_WITHOUT_TEST_CLIENT=ON \
-DLWS_WITHOUT_TEST_PING=ON \
-DLWS_WITHOUT_TEST_SERVER=ON \
-DLWS_WITHOUT_TEST_SERVER_EXTPOLL=ON \
-DLWS_WITH_STATIC=OFF"
# Build guacamole-server and its core protocol library dependencies
RUN echo "$TARGETPLATFORM"
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; \
then FREERDP_OPTS="${FREERDP_OPTS} -DWITH_SSE2=ON" && echo "SSE2 active"; \
else FREERDP_OPTS="${FREERDP_OPTS} -DWITH_SSE2=OFF" && echo "SSE2 disabled"; \
fi && ${BUILD_DIR}/src/guacd-docker/bin/build-all.sh
# Record the packages of all runtime library dependencies
RUN ${BUILD_DIR}/src/guacd-docker/bin/list-dependencies.sh \
${PREFIX_DIR}/sbin/guacd \
${PREFIX_DIR}/lib/libguac-client-*.so \
${PREFIX_DIR}/lib/freerdp2/*guac*.so \
> ${PREFIX_DIR}/DEPENDENCIES
# Use same Alpine version as the base for the runtime image
FROM alpine:${ALPINE_BASE_IMAGE}
RUN sed -i 's!https://dl-cdn.alpinelinux.org/!https://mirrors.ustc.edu.cn/!g' /etc/apk/repositories
#
# Base directory for installed build artifacts. See also the
# CMD directive at the end of this build stage.
#
# NOTE: Due to limitations of the Docker image build process, this value is
# duplicated in an ARG in the first stage of the build.
#
ARG PREFIX_DIR=/opt/guacamole
# Runtime environment
ENV LC_ALL=C.UTF-8
ENV LD_LIBRARY_PATH=${PREFIX_DIR}/lib
ENV GUACD_LOG_LEVEL=info
# Copy build artifacts into this stage
COPY --from=builder ${PREFIX_DIR} ${PREFIX_DIR}
# Bring runtime environment up to date and install runtime dependencies
RUN apk add --no-cache \
ca-certificates \
ghostscript \
netcat-openbsd \
shadow \
terminus-font \
ttf-dejavu \
ttf-liberation \
util-linux-login && \
xargs apk add --no-cache < ${PREFIX_DIR}/DEPENDENCIES
# Checks the operating status every 5 minutes with a timeout of 5 seconds
HEALTHCHECK --interval=5m --timeout=5s CMD nc -z 127.0.0.1 4822 || exit 1
# Create a new user guacd
ARG UID=1000
ARG GID=1000
RUN groupadd --gid $GID guacd
RUN useradd --system --create-home --shell /sbin/nologin --uid $UID --gid $GID guacd
RUN mkdir -p /opt/cloudpods
RUN chown -R guacd:guacd /opt/cloudpods
# Run with user guacd
USER guacd
# Expose the default listener port
EXPOSE 4822
# Start guacd, listening on port 0.0.0.0:4822
#
# Note the path here MUST correspond to the value specified in the
# PREFIX_DIR build argument.
#
CMD /opt/guacamole/sbin/guacd -b 0.0.0.0 -L $GUACD_LOG_LEVEL -f

View File

@@ -1,4 +1,4 @@
FROM registry.cn-beijing.aliyuncs.com/yunionio/host-deployer-base:1.4
FROM registry.cn-beijing.aliyuncs.com/yunionio/host-deployer-base:1.4.6
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 .
@@ -64,3 +64,13 @@ host-image:
LBAGENT_BASE_VERSION = v0.0.3
lbagent-base:
$(DOCKER_BUILDX)/lbagent-base:$(LBAGENT_BASE_VERSION) -f ./Dockerfile.lbagent-base .
GUACD_VERSION=1.5.3
guacd:
docker buildx build --platform linux/arm64 --push \
-t registry.cn-beijing.aliyuncs.com/yunionio/guacd:$(GUACD_VERSION)-arm64 -f ./Dockerfile.guacd .
docker buildx build --platform linux/amd64 --push \
-t registry.cn-beijing.aliyuncs.com/yunionio/guacd:$(GUACD_VERSION)-amd64 -f ./Dockerfile.guacd .
docker buildx imagetools create -t registry.cn-beijing.aliyuncs.com/yunionio/guacd:$(GUACD_VERSION) \
registry.cn-beijing.aliyuncs.com/yunionio/guacd:$(GUACD_VERSION)-amd64 \
registry.cn-beijing.aliyuncs.com/yunionio/guacd:$(GUACD_VERSION)-arm64

View File

@@ -25,6 +25,6 @@ func init() {
cmd := shell.NewResourceCmd(&modules.AccessGroups).WithKeyword("access-group")
cmd.List(&compute.AccessGroupListOptions{})
cmd.Delete(&options.BaseIdOptions{})
cmd.Create(&options.BaseCreateOptions{})
cmd.Create(&compute.AccessGroupCreateOptions{})
cmd.Perform("syncstatus", &options.BaseIdOptions{})
}

View File

@@ -26,6 +26,7 @@ func init() {
bsCmd.List(&compute.BackupStorageListOptions{})
bsCmd.Show(&compute.BackupStorageIdOptions{})
bsCmd.Create(&compute.BackupStorageCreateOptions{})
bsCmd.Update(&compute.BackupStorageUpdateOptions{})
bsCmd.Delete(&compute.BackupStorageIdOptions{})
bsCmd.Perform("public", &options.BasePublicOptions{})
bsCmd.Perform("private", &options.BaseIdOptions{})

View File

@@ -41,6 +41,7 @@ func init() {
cmd.CreateWithKeyword("create-hcs", &options.SHCSAccountCreateOptions{})
cmd.CreateWithKeyword("create-hcsop", &options.SHcsOpCloudAccountCreateOptions{})
cmd.CreateWithKeyword("create-ucloud", &options.SUcloudCloudAccountCreateOptions{})
cmd.CreateWithKeyword("create-volcengine", &options.SVolcengineCloudAccountCreateOptions{})
cmd.CreateWithKeyword("create-zstack", &options.SZStackCloudAccountCreateOptions{})
cmd.CreateWithKeyword("create-s3", &options.SS3CloudAccountCreateOptions{})
cmd.CreateWithKeyword("create-ceph", &options.SCephCloudAccountCreateOptions{})
@@ -59,6 +60,7 @@ func init() {
cmd.CreateWithKeyword("create-baidu", &options.SBaiduCloudAccountCreateOptions{})
cmd.CreateWithKeyword("create-cucloud", &options.SCucloudCloudAccountCreateOptions{})
cmd.CreateWithKeyword("create-qingcloud", &options.SQingCloudCloudAccountCreateOptions{})
cmd.CreateWithKeyword("create-oracle", &options.SOracleCloudAccountCreateOptions{})
cmd.UpdateWithKeyword("update-vmware", &options.SVMwareCloudAccountUpdateOptions{})
cmd.UpdateWithKeyword("update-aliyun", &options.SAliyunCloudAccountUpdateOptions{})
@@ -71,6 +73,7 @@ func init() {
cmd.UpdateWithKeyword("update-hcso", &options.SHCSOAccountUpdateOptions{})
cmd.UpdateWithKeyword("update-hcs", &options.SHCSAccountUpdateOptions{})
cmd.UpdateWithKeyword("update-ucloud", &options.SUcloudCloudAccountUpdateOptions{})
cmd.UpdateWithKeyword("update-volcengine", &options.SVolcengineCloudAccountUpdateOptions{})
cmd.UpdateWithKeyword("update-zstack", &options.SZStackCloudAccountUpdateOptions{})
cmd.UpdateWithKeyword("update-s3", &options.SS3CloudAccountUpdateOptions{})
cmd.UpdateWithKeyword("update-ctyun", &options.SCtyunCloudAccountUpdateOptions{})
@@ -99,6 +102,7 @@ func init() {
cmd.PerformWithKeyword("update-credential-hcso", "update-credential", &options.SHCSOAccountUpdateCredentialOptions{})
cmd.PerformWithKeyword("update-credential-hcs", "update-credential", &options.SHCSOAccountUpdateCredentialOptions{})
cmd.PerformWithKeyword("update-credential-ucloud", "update-credential", &options.SUcloudCloudAccountUpdateCredentialOptions{})
cmd.PerformWithKeyword("update-credential-volcengine", "update-credential", &options.SVolcengineCloudAccountUpdateCredentialOptions{})
cmd.PerformWithKeyword("update-credential-zstack", "update-credential", &options.SZStackCloudAccountUpdateCredentialOptions{})
cmd.PerformWithKeyword("update-credential-s3", "update-credential", &options.SS3CloudAccountUpdateCredentialOptions{})
cmd.PerformWithKeyword("update-credential-ctyun", "update-credential", &options.SCtyunCloudAccountUpdateCredentialOptions{})
@@ -122,6 +126,7 @@ func init() {
cmd.PerformWithKeyword("test-connectivity-openstack", "test-connectivity", &options.SOpenStackCloudAccountUpdateCredentialOptions{})
cmd.PerformWithKeyword("test-connectivity-huawei", "test-connectivity", &options.SHuaweiCloudAccountUpdateCredentialOptions{})
cmd.PerformWithKeyword("test-connectivity-ucloud", "test-connectivity", &options.SUcloudCloudAccountUpdateCredentialOptions{})
cmd.PerformWithKeyword("test-connectivity-volcengine", "test-connectivity", &options.SVolcengineCloudAccountUpdateCredentialOptions{})
cmd.PerformWithKeyword("test-connectivity-zstack", "test-connectivity", &options.SZStackCloudAccountUpdateCredentialOptions{})
cmd.PerformWithKeyword("test-connectivity-s3", "test-connectivity", &options.SS3CloudAccountUpdateCredentialOptions{})
cmd.PerformWithKeyword("test-connectivity-ctyun", "test-connectivity", &options.SCtyunCloudAccountUpdateCredentialOptions{})

View File

@@ -38,7 +38,7 @@ func init() {
Usable *bool `help:"List regions where networks are usable"`
UsableVpc *bool `help:"List regions where VPC are usable"`
Service string `help:"List regions which service has available skus" choices:"dbinstances|servers"`
Service string `help:"List regions which service has available skus" choices:"dbinstances|servers|elasticcaches"`
City string `help:"List regions in the specified city"`

View File

@@ -23,6 +23,7 @@ import (
"yunion.io/x/log"
"yunion.io/x/pkg/errors"
"yunion.io/x/pkg/util/httputils"
"yunion.io/x/pkg/util/printutils"
"yunion.io/x/onecloud/cmd/climc/shell"
"yunion.io/x/onecloud/pkg/mcclient"
@@ -69,13 +70,26 @@ func init() {
cmd.Get("vnc", &options.BaseIdOptions{})
cmd.Get("app-options", &options.BaseIdOptions{})
cmd.Get("tap-config", &options.BaseIdOptions{})
cmd.GetWithCustomShow("nics", func(data jsonutils.JSONObject) {
results := printutils.ListResult{}
err := data.Unmarshal(&results)
if err == nil {
printutils.PrintJSONList(&results, []string{
"mac",
"vlan_id",
"interface",
"bridge",
"ip_addr",
"net",
"wire",
})
} else {
fmt.Println("error", err)
}
}, &options.BaseIdOptions{})
R(&options.BaseIdOptions{}, "host-logininfo", "Get SSH login information of a host", func(s *mcclient.ClientSession, args *options.BaseIdOptions) error {
srvid, e := modules.Hosts.GetId(s, args.ID, nil)
if e != nil {
return e
}
i, e := modules.Hosts.GetLoginInfo(s, srvid, nil)
i, e := modules.Hosts.PerformAction(s, args.ID, "login-info", nil)
if e != nil {
return e
}
@@ -168,8 +182,9 @@ func init() {
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"`
@@ -220,6 +235,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")
}
@@ -576,11 +598,7 @@ func init() {
Port int `help:"SSH service port" default:"22"`
}
R(&HostSSHLoginOptions{}, "host-ssh", "SSH login of a host", func(s *mcclient.ClientSession, args *HostSSHLoginOptions) error {
srvid, e := modules.Hosts.GetId(s, args.ID, nil)
if e != nil {
return e
}
i, e := modules.Hosts.GetLoginInfo(s, srvid, nil)
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" {

View File

@@ -26,4 +26,6 @@ func init() {
cmd.Create(new(options.IsolatedDeviceModelCreateOptions))
cmd.Update(new(options.IsolatedDeviceModelUpdateOptions))
cmd.Delete(new(options.IsolatedDeviceIdsOptions))
cmd.Perform("set-hardware-info", new(options.IsolatedDeviceModelSetHardwareInfoOptions))
cmd.Get("hardware-info", new(options.IsolatedDeviceIdsOptions))
}

View File

@@ -1,3 +1,17 @@
// 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 (

View File

@@ -32,6 +32,7 @@ func init() {
cmd := shell.NewResourceCmd(&modules.Networks).WithContextManager(&modules.Wires)
cmd.List(&compute_options.NetworkListOptions{})
cmd.Create(&compute_options.NetworkCreateOptions{})
cmd.Update(&compute_options.NetworkUpdateOptions{})
cmd.Show(&compute_options.NetworkIdOptions{})
cmd.Delete(&compute_options.NetworkIdOptions{})
@@ -43,6 +44,8 @@ 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.Perform("sync-additional-wires", &compute_options.NetworkSyncAdditionalWiresOptions{})
cmd.Get("available-addresses", &compute_options.NetworkIdOptions{})
type NetworkShareOptions struct {
ID string `help:"ID or Name of the zone to show"`
@@ -60,65 +63,15 @@ func init() {
return nil
})
type NetworkCreateOptions struct {
WIRE string `help:"ID or Name of wire in which the network is created"`
NETWORK string `help:"Name of new network"`
STARTIP string `help:"Start of IPv4 address range"`
ENDIP string `help:"End of IPv4 address rnage"`
NETMASK int64 `help:"Length of network mask"`
Gateway string `help:"Default gateway"`
VlanId int64 `help:"Vlan ID" default:"1"`
IfnameHint string `help:"Hint for ifname generation"`
AllocPolicy string `help:"Address allocation policy" choices:"none|stepdown|stepup|random"`
ServerType string `help:"Server type" choices:"baremetal|container|eip|guest|ipmi|pxe"`
IsAutoAlloc *bool `help:"Auto allocation IP pool"`
BgpType string `help:"Internet service provider name" positional:"false"`
Desc string `help:"Description" metavar:"DESCRIPTION"`
}
R(&NetworkCreateOptions{}, "network-create", "Create a virtual network", func(s *mcclient.ClientSession, args *NetworkCreateOptions) error {
params := jsonutils.NewDict()
params.Add(jsonutils.NewString(args.NETWORK), "name")
params.Add(jsonutils.NewString(args.STARTIP), "guest_ip_start")
params.Add(jsonutils.NewString(args.ENDIP), "guest_ip_end")
params.Add(jsonutils.NewInt(args.NETMASK), "guest_ip_mask")
if len(args.Gateway) > 0 {
params.Add(jsonutils.NewString(args.Gateway), "guest_gateway")
}
if args.VlanId > 0 {
params.Add(jsonutils.NewInt(args.VlanId), "vlan_id")
}
if len(args.ServerType) > 0 {
params.Add(jsonutils.NewString(args.ServerType), "server_type")
}
if len(args.IfnameHint) > 0 {
params.Add(jsonutils.NewString(args.IfnameHint), "ifname_hint")
}
if len(args.AllocPolicy) > 0 {
params.Add(jsonutils.NewString(args.AllocPolicy), "alloc_policy")
}
if len(args.Desc) > 0 {
params.Add(jsonutils.NewString(args.Desc), "description")
}
if len(args.BgpType) > 0 {
params.Add(jsonutils.NewString(args.BgpType), "bgp_type")
}
if args.IsAutoAlloc != nil {
params.Add(jsonutils.NewBool(*args.IsAutoAlloc), "is_auto_alloc")
}
net, e := modules.Networks.CreateInContext(s, params, &modules.Wires, args.WIRE)
if e != nil {
return e
}
printObject(net)
return nil
})
type NetworkCreateOptions2 struct {
Wire string `help:"ID or Name of wire in which the network is created"`
Vpc string `help:"ID or Name of vpc in which the network is created"`
Zone string `help:"ID or Name of zone in which the network is created"`
NAME string `help:"Name of new network"`
PREFIX string `help:"Start of IPv4 address range"`
Wire string `help:"ID or Name of wire in which the network is created"`
Vpc string `help:"ID or Name of vpc in which the network is created"`
Zone string `help:"ID or Name of zone in which the network is created"`
NAME string `help:"Name of new network"`
PREFIX string `help:"IPv4 prefix"`
Prefix6 string `help:"IPv6 prefix"`
BgpType string `help:"Internet service provider name" positional:"false"`
AssignPublicIp bool
Desc string `help:"Description" metavar:"DESCRIPTION"`
@@ -127,6 +80,11 @@ func init() {
params := jsonutils.NewDict()
params.Add(jsonutils.NewString(args.NAME), "name")
params.Add(jsonutils.NewString(args.PREFIX), "guest_ip_prefix")
if len(args.Prefix6) > 0 {
params.Add(jsonutils.NewString(args.Prefix6), "guest_ip6_prefix")
}
params.Set("assign_public_ip", jsonutils.NewBool(args.AssignPublicIp))
if len(args.BgpType) > 0 {
params.Add(jsonutils.NewString(args.BgpType), "bgp_type")

View File

@@ -27,13 +27,10 @@ func init() {
cmd.Show(&options.SecgroupIdOptions{})
cmd.Update(&options.BaseUpdateOptions{})
cmd.Delete(&options.SecgroupIdOptions{})
cmd.Perform("merge", &options.SecgroupMergeOptions{})
cmd.Perform("public", &options.SecgroupIdOptions{})
cmd.Perform("syncstatus", &options.SecgroupIdOptions{})
cmd.Perform("private", &options.SecgroupIdOptions{})
cmd.Perform("add-rule", &options.SecgroupsAddRuleOptions{})
cmd.Perform("cache-secgroup", &options.SecurityGroupCacheOptions{})
cmd.Perform("uncache-secgroup", &options.SecurityGroupUncacheSecurityGroup{})
cmd.Perform("purge", &options.SecgroupIdOptions{})
cmd.Perform("change-owner", &options.SecgroupChangeOwnerOptions{})
cmd.Perform("import-rules", &options.SecgroupImportRulesOptions{})
}

View File

@@ -115,11 +115,17 @@ func init() {
cmd.Perform("qga-set-password", &options.ServerQgaSetPassword{})
cmd.Perform("qga-command", &options.ServerQgaCommand{})
cmd.Perform("qga-ping", &options.ServerQgaPing{})
cmd.Perform("qga-guest-info-task", &options.ServerQgaGuestInfoTask{})
cmd.Perform("qga-get-network", &options.ServerQgaGetNetwork{})
cmd.Perform("set-password", &options.ServerSetPasswordOptions{})
cmd.Perform("set-boot-index", &options.ServerSetBootIndexOptions{})
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.Get("vnc", new(options.ServerVncOptions))
cmd.Get("desc", new(options.ServerIdOptions))
@@ -133,6 +139,7 @@ func init() {
cmd.Get("cpuset-cores", new(options.ServerIdOptions))
cmd.Get("sshport", new(options.ServerIdOptions))
cmd.Get("qemu-info", new(options.ServerIdOptions))
cmd.Get("hardware-info", new(options.ServerIdOptions))
cmd.GetProperty(&options.ServerStatusStatisticsOptions{})
cmd.GetProperty(&options.ServerProjectStatisticsOptions{})
@@ -299,11 +306,6 @@ func init() {
})
R(&options.ServerLoginInfoOptions{}, "server-logininfo", "Get login info of a server", func(s *mcclient.ClientSession, opts *options.ServerLoginInfoOptions) error {
srvid, e := modules.Servers.GetId(s, opts.ID, nil)
if e != nil {
return e
}
params := jsonutils.NewDict()
if len(opts.Key) > 0 {
privateKey, e := ioutil.ReadFile(opts.Key)
@@ -313,7 +315,7 @@ func init() {
params.Add(jsonutils.NewString(string(privateKey)), "private_key")
}
i, e := modules.Servers.GetLoginInfo(s, srvid, params)
i, e := modules.Servers.PerformAction(s, opts.ID, "login-info", params)
if e != nil {
return e
}
@@ -865,7 +867,7 @@ func init() {
privateKey = string(key)
}
i, e := modules.Servers.GetLoginInfo(s, srvid, params)
i, e := modules.Servers.PerformAction(s, srvid, "login-info", params)
if e != nil {
return e
}

View File

@@ -15,112 +15,18 @@
package compute
import (
"yunion.io/x/jsonutils"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/cmd/climc/shell"
modules "yunion.io/x/onecloud/pkg/mcclient/modules/compute"
"yunion.io/x/onecloud/pkg/mcclient/options"
"yunion.io/x/onecloud/pkg/mcclient/options/compute"
)
func init() {
type SnapshotPolicyListOptions struct {
options.BaseListOptions
OrderByBindDiskCount string
}
R(&SnapshotPolicyListOptions{}, "snapshot-policy-list", "List snapshot policy", func(s *mcclient.ClientSession, args *SnapshotPolicyListOptions) error {
params, err := options.ListStructToParams(args)
if err != nil {
return err
}
result, err := modules.SnapshotPoliciy.List(s, params)
if err != nil {
return err
}
printList(result, modules.SnapshotPoliciy.GetColumns(s))
return nil
})
type SnapshotPolicyDeleteOptions struct {
ID string `help:"Delete snapshot id"`
}
R(&SnapshotPolicyDeleteOptions{}, "snapshot-policy-delete", "Delete snapshot policy", func(s *mcclient.ClientSession, args *SnapshotPolicyDeleteOptions) error {
result, err := modules.SnapshotPoliciy.Delete(s, args.ID, nil)
if err != nil {
return err
}
printObject(result)
return nil
})
type SnapshotPolicyCreateOptions struct {
NAME string
RetentionDays int `help:"snapshot retention days"`
RepeatWeekdays []int `help:"snapshot create days on week"`
TimePoints []int `help:"snapshot create time points on one day"`
}
R(&SnapshotPolicyCreateOptions{}, "snapshot-policy-create", "Create snapshot policy", func(s *mcclient.ClientSession, args *SnapshotPolicyCreateOptions) error {
params := jsonutils.Marshal(args).(*jsonutils.JSONDict)
snapshot, err := modules.SnapshotPoliciy.Create(s, params)
if err != nil {
return err
}
printObject(snapshot)
return nil
})
type SnapshotPolicyBindDisksOptions struct {
ID string `help:"ID"`
Disk []string `help:"ids of disk"`
}
R(&SnapshotPolicyBindDisksOptions{}, "snapshot-policy-bind-disk", "bind snapshotpolicy to disks",
func(s *mcclient.ClientSession, opts *SnapshotPolicyBindDisksOptions) error {
params, err := options.StructToParams(opts)
if err != nil {
return err
}
sp, err := modules.SnapshotPoliciy.PerformAction(s, opts.ID, "bind-disks", params)
if err != nil {
return err
}
printObject(sp)
return nil
})
R(&SnapshotPolicyBindDisksOptions{}, "snapshot-policy-unbind-disk", "bind snapshotpolicy to disks",
func(s *mcclient.ClientSession, opts *SnapshotPolicyBindDisksOptions) error {
params, err := options.StructToParams(opts)
if err != nil {
return err
}
sp, err := modules.SnapshotPoliciy.PerformAction(s, opts.ID, "unbind-disks", params)
if err != nil {
return err
}
printObject(sp)
return nil
})
type SnapshotPolicyCacheOptions struct {
ID string `help:"SnasphotPolicy ID"`
REGIONID string `help:"Region ID"`
PROVIDER string `help:"Provider ID"`
}
R(&SnapshotPolicyCacheOptions{}, "snapshot-policy-cache", "upload local snapshotpolicy to cloud",
func(s *mcclient.ClientSession, opts *SnapshotPolicyCacheOptions) error {
params, err := options.StructToParams(opts)
if err != nil {
return err
}
sp, err := modules.SnapshotPoliciy.PerformAction(s, opts.ID, "cache", params)
if err != nil {
return err
}
printObject(sp)
return nil
},
)
cmd := shell.NewResourceCmd(&modules.SnapshotPoliciy).WithKeyword("snapshot-policy")
cmd.List(&compute.SnapshotPolicyListOptions{})
cmd.Delete(&options.BaseIdOptions{})
cmd.Create(&compute.SnapshotPolicyCreateOptions{})
cmd.Perform("bind-disks", &compute.SnapshotPolicyDisksOptions{})
cmd.Perform("unbind-disks", &compute.SnapshotPolicyDisksOptions{})
cmd.Perform("syncstatus", &options.BaseIdOptions{})
}

View File

@@ -1,80 +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/jsonutils"
"yunion.io/x/onecloud/pkg/mcclient"
modules "yunion.io/x/onecloud/pkg/mcclient/modules/compute"
)
func init() {
type SSnapshotpolicyDiskListOfDiskOption struct {
DISKID string `help:"disk id"`
}
R(&SSnapshotpolicyDiskListOfDiskOption{}, "disk-snapshot-policy-list", "List snapshot policy attached",
func(s *mcclient.ClientSession, opts *SSnapshotpolicyDiskListOfDiskOption) error {
result, err := modules.SnapshotPolicyDisk.ListDescendent(s, opts.DISKID, jsonutils.NewDict())
if err != nil {
return err
}
printList(result, modules.SnapshotPolicyDisk.GetColumns(s))
return nil
},
)
type SSnapshotpolicyDiskListOfSnapshotpolicyOption struct {
SNAPSHOTPOLICYID string `help:"snapshot policy id"`
}
R(&SSnapshotpolicyDiskListOfSnapshotpolicyOption{}, "snapshot-policy-disk-list", "List disk attached",
func(s *mcclient.ClientSession, opts *SSnapshotpolicyDiskListOfSnapshotpolicyOption) error {
result, err := modules.SnapshotPolicyDisk.ListDescendent2(s, opts.SNAPSHOTPOLICYID, jsonutils.NewDict())
if err != nil {
return err
}
printList(result, modules.SnapshotPolicyDisk.GetColumns(s))
return nil
},
)
type SSnapshotpolicyDiskAttachOption struct {
DISKID string `help:"disk id"`
SNAPSHOTPOLICYID string `help:"snapshot policy id"`
}
R(&SSnapshotpolicyDiskAttachOption{}, "disk-snapshot-policy-attach", "attach snapshot policy to disk",
func(s *mcclient.ClientSession, opts *SSnapshotpolicyDiskAttachOption) error {
_, err := modules.SnapshotPolicyDisk.Attach(s, opts.DISKID, opts.SNAPSHOTPOLICYID, jsonutils.NewDict())
if err != nil {
return err
}
return nil
},
)
type SSnapshotpolicyDiskDetachOption struct {
DISKID string `help:"disk id"`
SNAPSHOTPOLICYID string `help:"snapshot policy id"`
}
R(&SSnapshotpolicyDiskDetachOption{}, "disk-snapshot-policy-detach", "detach snapshot policy to disk",
func(s *mcclient.ClientSession, opts *SSnapshotpolicyDiskDetachOption) error {
_, err := modules.SnapshotPolicyDisk.Detach(s, opts.DISKID, opts.SNAPSHOTPOLICYID, jsonutils.NewDict())
if err != nil {
return err
}
return nil
},
)
}

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

@@ -15,92 +15,18 @@
package compute
import (
"yunion.io/x/jsonutils"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/cmd/climc/shell"
modules "yunion.io/x/onecloud/pkg/mcclient/modules/compute"
"yunion.io/x/onecloud/pkg/mcclient/options"
"yunion.io/x/onecloud/pkg/mcclient/options/compute"
)
func init() {
type StoragecacheListOptions struct {
options.BaseListOptions
CloudregionId string `help:"cloudregion id"`
}
R(&StoragecacheListOptions{}, "storage-cache-list", "List storage caches", func(s *mcclient.ClientSession, opts *StoragecacheListOptions) error {
params, err := options.ListStructToParams(opts)
if err != nil {
return err
}
result, err := modules.Storagecaches.List(s, params)
if err != nil {
return err
}
printList(result, modules.Storagecaches.GetColumns(s))
return nil
})
type StoragecacheShowptions struct {
ID string `help:"ID or Name of storagecache"`
}
R(&StoragecacheShowptions{}, "storage-cache-show", "Show details of storage caches", func(s *mcclient.ClientSession, args *StoragecacheShowptions) error {
result, err := modules.Storagecaches.Get(s, args.ID, nil)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&StoragecacheShowptions{}, "storage-cache-delete", "Delete storage cache", func(s *mcclient.ClientSession, args *StoragecacheShowptions) error {
result, err := modules.Storagecaches.Delete(s, args.ID, nil)
if err != nil {
return err
}
printObject(result)
return nil
})
type StorageCacheImageActionOptions struct {
ID string `help:"ID or name of storage"`
IMAGE string `help:"ID or name of image"`
Force bool `help:"Force refresh cache, even if the image exists in cache"`
Format string `help:"image format" choices:"iso|qcow2|vmdk|vhd"`
}
R(&StorageCacheImageActionOptions{}, "storagecache-cache-image", "Ask a storage cache to cache a image", func(s *mcclient.ClientSession, args *StorageCacheImageActionOptions) error {
params := jsonutils.NewDict()
params.Add(jsonutils.NewString(args.IMAGE), "image")
if args.Force {
params.Add(jsonutils.JSONTrue, "is_force")
}
if len(args.Format) > 0 {
params.Add(jsonutils.NewString(args.Format), "format")
}
storage, err := modules.Storagecaches.PerformAction(s, args.ID, "cache-image", params)
if err != nil {
return err
}
printObject(storage)
return nil
})
type StorageUncacheImageActionOptions struct {
ID string `help:"ID or name of storage"`
IMAGE string `help:"ID or name of image"`
Force bool `help:"Force uncache, even if the image exists in cache is invalid"`
}
R(&StorageUncacheImageActionOptions{}, "storagecache-uncache-image", "Ask a storage cache to remove image from its cache", func(s *mcclient.ClientSession, args *StorageUncacheImageActionOptions) error {
params := jsonutils.NewDict()
params.Add(jsonutils.NewString(args.IMAGE), "image")
if args.Force {
params.Add(jsonutils.JSONTrue, "is_force")
}
storage, err := modules.Storagecaches.PerformAction(s, args.ID, "uncache-image", params)
if err != nil {
return err
}
printObject(storage)
return nil
})
cmd := shell.NewResourceCmd(&modules.Storagecaches).WithKeyword("storage-cache")
cmd.List(&compute.StoragecacheListOptions{})
cmd.Show(&options.BaseIdOptions{})
cmd.Delete(&options.BaseIdOptions{})
cmd.Update(&options.BaseUpdateOptions{})
cmd.Perform("cache-image", &compute.StorageCacheImageActionOptions{})
cmd.Perform("uncache-image", &compute.StorageUncacheImageActionOptions{})
}

View File

@@ -45,6 +45,8 @@ func init() {
cmd.Perform("force-detach-host", &compute.StorageForceDetachHost{})
cmd.Perform("public", &options.BasePublicOptions{})
cmd.Perform("private", &options.BaseIdOptions{})
cmd.Get("hardware-info", &options.BaseIdOptions{})
cmd.Perform("set-hardware-info", &compute.StorageSetHardwareInfoOptions{})
type StorageCephRunOptions struct {
ID string `help:"ID or name of ceph storage"`

View File

@@ -15,19 +15,25 @@
package compute
import (
"yunion.io/x/jsonutils"
"fmt"
"time"
"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"
"yunion.io/x/onecloud/pkg/mcclient/modules/identity"
"yunion.io/x/onecloud/pkg/mcclient/modules/image"
"yunion.io/x/onecloud/pkg/mcclient/modules/k8s"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
type GeneralUsageOptions struct {
HostType []string `help:"Host types" choices:"hypervisor|baremetal|esxi|xen|kubelet|hyperv|aliyun|azure|aws|huawei|qcloud|openstack|ucloud|zstack|google|ctyun"`
Provider []string `help:"Provider" choices:"OneCloud|VMware|Aliyun|Azure|Aws|Qcloud|Huawei|OpenStack|Ucloud|ZStack|Google|Ctyun"`
Brand []string `help:"Brands" choices:"OneCloud|VMware|Aliyun|Azure|Aws|Qcloud|Huawei|OpenStack|Ucloud|ZStack|DStack|Google|Ctyun"`
Provider []string `help:"Provider" choices:"OneCloud|VMware|Aliyun|Azure|Aws|Qcloud|Huawei|OpenStack|Ucloud|VolcEngine|ZStack|Google|Ctyun"`
Brand []string `help:"Brands" choices:"OneCloud|VMware|Aliyun|Azure|Aws|Qcloud|Huawei|OpenStack|Ucloud|VolcEngine|ZStack|DStack|Google|Ctyun"`
Project string `help:"show usage of specified project"`
ProjectDomain string `help:"show usage of specified domain"`
@@ -58,7 +64,50 @@ func fetchHostTypeOptions(args *GeneralUsageOptions) *jsonutils.JSONDict {
return params
}
type HistoryUsageListOptions struct {
options.ExtraListOptions
StartDate time.Time
EndDate time.Time
Interval string `choices:"hour|day|month|year" default:"day"`
}
func (opts *HistoryUsageListOptions) Params() (jsonutils.JSONObject, error) {
if opts.StartDate.IsZero() || opts.EndDate.IsZero() {
opts.EndDate = time.Now()
switch opts.Interval {
case "hour":
opts.StartDate = time.Now().Add(time.Hour * -24)
case "day":
opts.StartDate = time.Now().AddDate(0, 0, -30)
case "month":
opts.StartDate = time.Now().AddDate(0, -12, 0)
case "year":
opts.StartDate = time.Now().AddDate(-3, 0, 0)
}
}
return jsonutils.Marshal(opts), nil
}
func (o *HistoryUsageListOptions) GetExportKeys() string {
return ""
}
func (o *HistoryUsageListOptions) GetId() string {
return ""
}
func init() {
cmd := shell.NewResourceCmd(modules.HistoryUsages)
cmd.GetWithCustomShow("list", func(data jsonutils.JSONObject) {
ret := map[string][]jsonutils.JSONObject{}
data.Unmarshal(&ret)
for k, d := range ret {
fmt.Println(k)
printutils.PrintJSONList(&printutils.ListResult{Data: d}, nil)
}
}, &HistoryUsageListOptions{})
R(&GeneralUsageOptions{}, "usage", "Show general usage", func(s *mcclient.ClientSession, args *GeneralUsageOptions) error {
params := fetchHostTypeOptions(args)
if args.Project != "" {

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 {
@@ -117,7 +122,7 @@ func init() {
if err != nil {
return err
}
ret, err := webconsole.WebConsole.DoSshConnect(s, args.IP, params)
ret, err := webconsole.WebConsole.DoSshConnect(s, args.ID, params)
if err != nil {
return err
}
@@ -133,4 +138,14 @@ func init() {
handleResult(s, args.WebConsoleOptions, ret)
return nil
})
R(&o.WebConsoleServerRdpOptions{}, "webconsole-server-rdp", "Connect server remote graphic console by rdp", func(s *mcclient.ClientSession, args *o.WebConsoleServerRdpOptions) error {
ret, err := webconsole.WebConsole.DoServerRDPConnect(s, args.ID, jsonutils.Marshal(map[string]interface{}{"webconsole": args}))
if err != nil {
return err
}
handleResult(s, args.WebConsoleOptions, ret)
return 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) {

View File

@@ -31,4 +31,5 @@ func init() {
orgCmd.Delete(&identity_options.OrganizationIdOptions{})
orgCmd.Perform("add-level", &identity_options.OrganizationAddLevelOptions{})
orgCmd.Perform("add-node", &identity_options.OrganizationAddNodeOptions{})
orgCmd.Perform("clean", &identity_options.OrganizationIdOptions{})
}

View File

@@ -40,7 +40,7 @@ import (
"yunion.io/x/onecloud/pkg/util/tagutils"
)
func createPolicy(s *mcclient.ClientSession, name string, genName string, policy string, domain string, enabled bool, disabled bool, desc string, scope string, isSystem *bool, objectags, projecttags, domaintags tagutils.TTagSet) error {
func createPolicy(s *mcclient.ClientSession, name string, genName string, policy string, domain string, enabled bool, disabled bool, desc string, scope string, isSystem *bool, objectags, projecttags, domaintags tagutils.TTagSet, orgNodeId []string) error {
params := jsonutils.NewDict()
if len(genName) > 0 {
params.Add(jsonutils.NewString(genName), "generate_name")
@@ -83,6 +83,10 @@ func createPolicy(s *mcclient.ClientSession, name string, genName string, policy
params.Add(jsonutils.Marshal(domaintags), "domain_tags")
}
if len(orgNodeId) > 0 {
params.Add(jsonutils.NewStringArray(orgNodeId), "org_node_id")
}
result, err := modules.Policies.Create(s, params)
if err != nil {
return err
@@ -115,7 +119,12 @@ func createPolicyFromJson(s *mcclient.ClientSession, old jsonutils.JSONObject, a
domainTags = make(tagutils.TTagSet, 0)
old.Unmarshal(&domainTags, "domain_tags")
}
return createPolicy(s, argsName, genName, policy, argsDomain, enabled, !enabled, desc, scope, &isSystem, objectTags, projectTags, domainTags)
var nodeIds []string
if old.Contains("org_node_id") {
nodeIds = make([]string, 0)
old.Unmarshal(&nodeIds, "org_node_id")
}
return createPolicy(s, argsName, genName, policy, argsDomain, enabled, !enabled, desc, scope, &isSystem, objectTags, projectTags, domainTags, nodeIds)
}
func init() {
@@ -141,6 +150,8 @@ func init() {
ProjectTags string `help:"project tags"`
DomainTags string `help:"domain tags"`
ObjectTags string `help:"object tags"`
OrgNodeId []string `help:"node ids of organiazation tree node"`
}
R(&PolicyCreateOptions{}, "policy-create", "Create a new policy", func(s *mcclient.ClientSession, args *PolicyCreateOptions) error {
policyBytes, err := ioutil.ReadFile(args.FILE)
@@ -151,7 +162,7 @@ func init() {
objectTags := baseoptions.SplitTag(args.ObjectTags)
projectTags := baseoptions.SplitTag(args.ProjectTags)
domainTags := baseoptions.SplitTag(args.DomainTags)
return createPolicy(s, args.NAME, "", string(policyBytes), args.Domain, args.Enabled, args.Disabled, args.Desc, args.Scope, args.IsSystem, objectTags, projectTags, domainTags)
return createPolicy(s, args.NAME, "", string(policyBytes), args.Domain, args.Enabled, args.Disabled, args.Desc, args.Scope, args.IsSystem, objectTags, projectTags, domainTags, args.OrgNodeId)
})
type PolicyExportOptions struct {
@@ -213,6 +224,8 @@ func init() {
ProjectTags string `help:"project tags"`
DomainTags string `help:"domain tags"`
ObjectTags string `help:"object tags"`
OrgNodeId []string `help:"node ids of organiazation tree node"`
}
updateFunc := func(s *mcclient.ClientSession, args *PolicyPatchOptions) error {
policyId, err := modules.Policies.GetId(s, args.ID, nil)
@@ -262,6 +275,10 @@ func init() {
params.Add(jsonutils.NewString(args.TagsAction), "tag_update_policy")
}
if len(args.OrgNodeId) > 0 {
params.Add(jsonutils.NewStringArray(args.OrgNodeId), "org_node_id")
}
result, err := modules.Policies.Update(s, policyId, params)
if err != nil {
return err

View File

@@ -40,6 +40,7 @@ func init() {
cmd.GetProperty(&identity_options.ProjectGetPropertyTagValueTreeOptions{})
cmd.GetProperty(&identity_options.ProjectGetPropertyDomainTagValuePairOptions{})
cmd.GetProperty(&identity_options.ProjectGetPropertyDomainTagValueTreeOptions{})
cmd.PerformClass("clean", &identity_options.ProjectCleanOptions{})
type ProjectShowOptions struct {
ID string `help:"ID or Name of project"`

View File

@@ -162,6 +162,18 @@ func init() {
return nil
})
type ServiceConfigShow2Options struct {
TYPE string `help:"service type"`
}
R(&ServiceConfigShow2Options{}, "service-config-show2", "Show configs of a service", func(s *mcclient.ClientSession, args *ServiceConfigShow2Options) error {
conf, err := modules.ServicesV3.GetConfig(s, args.TYPE)
if err != nil {
return err
}
fmt.Println(conf.PrettyString())
return nil
})
type ServiceConfigOptions struct {
SERVICE string `help:"service name or id"`
Config []string `help:"config options, can be a JSON, a YAML or a key=value pair, e.g:\n * JSON\n '{\"default\":{\"password_expiration_seconds\":300}}'\n * YAML\n default:\n password_expiration_seconds: 300\n * A key=value pair (under default section)\n password_expiration_seconds=300\n"`

View File

@@ -66,6 +66,8 @@ func init() {
"baidu",
"cucloud",
"qingcloud",
"volcengine",
"oracle",
}
const (

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,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

@@ -138,4 +138,28 @@ func init() {
}
return nil
})
type NotificationContactInput struct {
Subject string
Body string
ContactType []string
ReceiverIds []string
RobotIds []string
RoleIds []string
}
R(&NotificationContactInput{}, "notify-contact-send", "Send notify event message", func(s *mcclient.ClientSession, args *NotificationContactInput) error {
params := api.NotificationManagerContactNotifyInput{
Subject: args.Subject,
Body: args.Body,
ReceiverIds: args.ReceiverIds,
ContactTypes: args.ContactType,
RobotIds: args.RobotIds,
RoleIds: args.RoleIds,
}
_, err := modules.Notification.PerformClassAction(s, "contact-notify", jsonutils.Marshal(params))
if err != nil {
return fmt.Errorf("unable to ContactNotify: %s", err)
}
return nil
})
}

View File

@@ -35,4 +35,5 @@ func init() {
cmd.PerformClass("intellij-get", new(options.ReceiverIntellijGetOptions))
cmd.PerformClass("get-types", new(options.ReceiverGetTypeOptions))
cmd.Perform("get-subscription", new(options.ReceiverGetSubscriptionOptions))
cmd.GetProperty(new(options.SReceiverRoleContactType))
}

View File

@@ -73,9 +73,10 @@ func init() {
}
type CycleTimer struct {
CycleCycleType string `help:"Cycle type for cycle timer" json:"cycle_type" choices:"day|week|month"`
CycleCycleType string `help:"Cycle type for cycle timer" json:"cycle_type" choices:"hour|day|week|month"`
CycleMinute int `help:"Minute of cycle timer" json:"minute"`
CycleHour int `help:"Hour of cycle timer" json:"hour"`
CycleCycleNum int `help:"Cycle count of cycle timer" json:"cycle_num"`
CycleWeekdays []int `help:"Weekdays for cycle timer" json:"weekdays"`
CycleMonthDays []int `help:"Month days for cycle timer" json:"month_days"`
CycleStartTime string `help:"Start time for cycle timer, format:'2006-01-02 15:04:05'" json:"start_time"`
@@ -123,6 +124,7 @@ func init() {
},
CycleTimer: apis.CycleTimerCreateInput{
CycleType: args.CycleCycleType,
CycleNum: args.CycleCycleNum,
Minute: args.CycleMinute,
Hour: args.CycleHour,
WeekDays: args.CycleWeekdays,

View File

@@ -0,0 +1,56 @@
// 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 yunionconf
import (
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules/yunionconf"
)
func init() {
type BugReportStatusOptions struct {
}
R(&BugReportStatusOptions{}, "bug-report-status", "Show bug report status", func(s *mcclient.ClientSession, args *BugReportStatusOptions) error {
ret, err := yunionconf.BugReport.GetBugReportEnabled(s, nil)
if err != nil {
return err
}
printObject(ret)
return nil
})
type BugReportEnableOptions struct {
}
R(&BugReportEnableOptions{}, "bug-report-enable", "Enable bug report", func(s *mcclient.ClientSession, args *BugReportEnableOptions) error {
ret, err := yunionconf.BugReport.DoBugReportEnable(s, nil)
if err != nil {
return err
}
printObject(ret)
return nil
})
R(&BugReportEnableOptions{}, "bug-report-disable", "Disable bug report", func(s *mcclient.ClientSession, args *BugReportEnableOptions) error {
ret, err := yunionconf.BugReport.DoBugReportDisable(s, nil)
if err != nil {
return err
}
printObject(ret)
return nil
})
}

View File

@@ -23,7 +23,9 @@ import (
"yunion.io/x/log"
api "yunion.io/x/onecloud/pkg/apis/cloudproxy"
common_app "yunion.io/x/onecloud/pkg/cloudcommon/app"
common_options "yunion.io/x/onecloud/pkg/cloudcommon/options"
"yunion.io/x/onecloud/pkg/cloudproxy/agent/worker"
"yunion.io/x/onecloud/pkg/cloudproxy/options"
"yunion.io/x/onecloud/pkg/cloudproxy/service"
@@ -33,42 +35,35 @@ import (
func main() {
defer atexit.Handle()
nop := true
wg := &sync.WaitGroup{}
ctx := context.Background()
ctx = context.WithValue(ctx, "wg", wg)
ctx, cancelFunc := context.WithCancel(ctx)
var (
opts = options.Get()
commonOpts = &opts.CommonOptions
opts = options.Get()
)
if opts.EnableAPIServer || opts.EnableProxyAgent {
common_app.InitAuth(commonOpts, func() {
log.Infof("Auth complete")
})
}
if opts.EnableAPIServer {
nop = false
wg.Add(1)
go func() {
defer wg.Done()
service.StartService()
}()
}
common_app.InitAuth(&opts.CommonOptions, func() {
log.Infof("Auth complete")
})
common_options.StartOptionManager(opts, opts.ConfigSyncPeriodSeconds, api.SERVICE_TYPE, api.SERVICE_VERSION, options.OnOptionsChange)
wg.Add(1)
go func() {
defer wg.Done()
service.StartService()
}()
if opts.EnableProxyAgent {
if opts.EnableAPIServer {
const d = "10m"
log.Infof("set proxy_agent_init_wait to %s", d)
opts.Options.ProxyAgentInitWait = d
}
const d = "10m"
log.Infof("set proxy_agent_init_wait to %s", d)
opts.Options.ProxyAgentInitWait = d
if err := opts.Options.ValidateThenInit(); err != nil {
log.Fatalf("proxy agent options validation: %v", err)
}
worker := worker.NewWorker(&opts.CommonOptions, &opts.Options)
nop = false
go func() {
worker.Start(ctx)
pid := os.Getpid()
@@ -79,17 +74,13 @@ func main() {
p.Signal(syscall.SIGTERM)
}()
}
if nop {
log.Warningln("nothing to do. Please check configuration")
} else {
go func() {
sigChan := make(chan os.Signal)
signal.Notify(sigChan, syscall.SIGINT)
signal.Notify(sigChan, syscall.SIGTERM)
sig := <-sigChan
log.Infof("signal received: %s", sig)
cancelFunc()
}()
wg.Wait()
}
go func() {
sigChan := make(chan os.Signal)
signal.Notify(sigChan, syscall.SIGINT)
signal.Notify(sigChan, syscall.SIGTERM)
sig := <-sigChan
log.Infof("signal received: %s", sig)
cancelFunc()
}()
wg.Wait()
}

View File

@@ -1,3 +1,17 @@
// 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 main
import (

View File

@@ -1,3 +1,17 @@
// 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 main
import (

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 {

22
go.mod
View File

@@ -31,6 +31,8 @@ require (
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
@@ -45,6 +47,7 @@ require (
github.com/minio/minio-go v6.0.14+incompatible
github.com/pierrec/lz4/v4 v4.1.15
github.com/pkg/errors v0.9.1
github.com/pkg/sftp v1.13.6
github.com/pquerna/otp v1.2.0
github.com/satori/go.uuid v1.2.0
github.com/sergi/go-diff v1.2.0
@@ -52,6 +55,7 @@ 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
@@ -62,6 +66,7 @@ require (
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
@@ -83,15 +88,15 @@ 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.20230919091951-01618b65262e
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240220074040-c367f1e9972c
yunion.io/x/executor v0.0.0-20230705125604-c5ac3141db32
yunion.io/x/jsonutils v1.0.1-0.20230613121553-0f3b41e2ef19
yunion.io/x/jsonutils v1.0.1-0.20240203102553-4096f103b401
yunion.io/x/log v1.0.1-0.20230411060016-feb3f46ab361
yunion.io/x/ovsdb v0.0.0-20230306173834-f164f413a900
yunion.io/x/pkg v1.0.1-0.20230912084455-1393f31347db
yunion.io/x/pkg v1.10.1-0.20240127153242-cdf9dc071f4f
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e
yunion.io/x/sqlchemy v1.1.2-0.20230823191329-dc02ac3a547c
yunion.io/x/structarg v0.0.0-20220312084958-9c6c79c7d1c6
yunion.io/x/sqlchemy v1.1.3-0.20240210161427-e48bb9a658b7
yunion.io/x/structarg v0.0.0-20231017124457-df4d5009457c
)
require (
@@ -132,6 +137,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
@@ -182,6 +188,7 @@ require (
github.com/jstemmer/go-junit-report v0.9.1 // indirect
github.com/jtolds/gls v4.20.0+incompatible // indirect
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect
github.com/kr/fs v0.1.0 // indirect
github.com/leodido/go-urn v1.2.0 // indirect
github.com/lestrrat-go/iter v0.0.0-20200422075355-fc1769541911 // indirect
github.com/lestrrat-go/pdebug v0.0.0-20200204225717-4d6bd78da58d // indirect
@@ -206,6 +213,7 @@ require (
github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492 // indirect
github.com/opentracing/opentracing-go v1.0.2 // indirect
github.com/openzipkin/zipkin-go-opentracing v0.3.4 // indirect
github.com/oracle/oci-go-sdk v24.3.0+incompatible // indirect
github.com/philhofer/fwd v1.0.0 // indirect
github.com/pierrec/lz4 v2.6.1+incompatible // indirect
github.com/pkg/term v1.0.0 // indirect
@@ -220,7 +228,6 @@ 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
@@ -233,6 +240,8 @@ require (
github.com/tklauser/numcpus v0.4.0 // indirect
github.com/ugorji/go/codec v1.1.7 // indirect
github.com/vmware/govmomi v0.20.1 // indirect
github.com/volcengine/ve-tos-golang-sdk/v2 v2.6.2 // indirect
github.com/volcengine/volc-sdk-golang v1.0.23 // indirect
github.com/willf/bitset v1.1.9 // indirect
github.com/willf/bloom v2.0.3+incompatible // indirect
github.com/xuri/efp v0.0.0-20220603152613-6918739fd470 // indirect
@@ -253,7 +262,6 @@ require (
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c // indirect
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.62.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect

47
go.sum
View File

@@ -81,6 +81,8 @@ github.com/LeeEirc/terminalparser v0.0.0-20220328021224-de16b7643ea4/go.mod h1:t
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=
@@ -144,6 +146,7 @@ github.com/aokoli/goutils v1.0.1 h1:7fpzNGoJ3VA8qcrm++XEE1QUe0mIwNeLa02Nwq7RDkg=
github.com/aokoli/goutils v1.0.1/go.mod h1:SijmP0QR8LtwsmDs8Yii5Z/S4trXFGFC2oO5g9DP+DQ=
github.com/apache/thrift v0.13.0 h1:5hryIiq9gtn+MiLVn0wP37kb/uTeRZgN08WoCsAhIhI=
github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
github.com/avast/retry-go v3.0.0+incompatible/go.mod h1:XtSnn+n/sHqQIpZ10K1qAevBhOOCWBLXXy3hyiqqBrY=
github.com/aws/aws-sdk-go v1.39.0 h1:74BBwkEmiqBbi2CGflEh34l0YNtIibTjZsibGarkNjo=
github.com/aws/aws-sdk-go v1.39.0/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro=
github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f h1:ZNv7On9kyUzm7fvRZumSyy/IUiSC7AzL0I1jKKtwooA=
@@ -172,6 +175,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=
@@ -420,6 +425,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=
@@ -457,6 +466,8 @@ github.com/koding/websocketproxy v0.0.0-20181220232114-7ed82d81a28c h1:N7A4JCA2G
github.com/koding/websocketproxy v0.0.0-20181220232114-7ed82d81a28c/go.mod h1:Nn5wlyECw3iJrzi0AhIWg+AJUb4PlRQVW4/3XHH1LZA=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/fs v0.1.0 h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8=
github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
@@ -565,6 +576,8 @@ github.com/opentracing/opentracing-go v1.0.2 h1:3jA2P6O1F9UOrWVpwrIo17pu01KWvNWg
github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
github.com/openzipkin/zipkin-go-opentracing v0.3.4 h1:x/pBv/5VJNWkcHF1G9xqhug8Iw7X1y1zOMzDmyuvP2g=
github.com/openzipkin/zipkin-go-opentracing v0.3.4/go.mod h1:js2AbwmHW0YD9DwIw2JhQWmbfFi/UnWyYwdVhqbCDOE=
github.com/oracle/oci-go-sdk v24.3.0+incompatible h1:x4mcfb4agelf1O4/1/auGlZ1lr97jXRSSN5MxTgG/zU=
github.com/oracle/oci-go-sdk v24.3.0+incompatible/go.mod h1:VQb79nF8Z2cwLkLS35ukwStZIg5F66tcBccjip/j888=
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
github.com/philhofer/fwd v1.0.0 h1:UbZqGr5Y38ApvM/V/jEljVxwocdweyH+vmYvRPBnbqQ=
github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU=
@@ -578,6 +591,8 @@ github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/sftp v1.13.6 h1:JFZT4XbOU7l77xGSpOdW+pwIMqP044IyjXX6FGyEKFo=
github.com/pkg/sftp v1.13.6/go.mod h1:tz1ryNURKu77RL+GuCzmoJYxQczL3wLNNpPWagdg4Qk=
github.com/pkg/term v1.0.0 h1:raTSNJjic7X4n89hhPyLOsgRYczmr3MyezRierWCTa8=
github.com/pkg/term v1.0.0/go.mod h1:6rk0zrj6TXf8MR5fdVFsZMeGM2lxe3tUFLNBRlwX+dk=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
@@ -598,6 +613,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=
@@ -709,6 +725,10 @@ github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaU
github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk=
github.com/vmware/govmomi v0.20.1 h1:7b/SeTUB3tER8ZLGLLLH3xcnB2xeuLULXmfPFqPSRZA=
github.com/vmware/govmomi v0.20.1/go.mod h1:URlwyTFZX72RmxtxuaFL2Uj3fD1JTvZdx59bHWk6aFU=
github.com/volcengine/ve-tos-golang-sdk/v2 v2.6.2 h1:FZ7zrUf70YKVuES50mHO3z2VW0K+Arq4uGlDqb+1VA0=
github.com/volcengine/ve-tos-golang-sdk/v2 v2.6.2/go.mod h1:IrjK84IJJTuOZOTMv/P18Ydjy/x+ow7fF7q11jAxXLM=
github.com/volcengine/volc-sdk-golang v1.0.23 h1:anOslb2Qp6ywnsbyq9jqR0ljuO63kg9PY+4OehIk5R8=
github.com/volcengine/volc-sdk-golang v1.0.23/go.mod h1:AfG/PZRUkHJ9inETvbjNifTDgut25Wbkm2QoYBTbvyU=
github.com/willf/bitset v1.1.3/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4=
github.com/willf/bitset v1.1.9 h1:GBtFynGY9ZWZmEC9sWuu41/7VBXPFCOAbCbqTflOg9c=
github.com/willf/bitset v1.1.9/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4=
@@ -729,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=
@@ -760,6 +782,7 @@ golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPh
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20201012173705-84dcc777aaee/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw=
golang.org/x/crypto v0.8.0 h1:pd9TJtTueMTVQXzk8E2XESSMQDj/U7OUu0PqJqPXQjQ=
golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
@@ -842,6 +865,7 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM=
golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
@@ -929,12 +953,14 @@ golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s=
golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.7.0 h1:BEvjmm5fURWqcfbSKTdpkDXYBrUS1c0m8agp14W48vQ=
golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY=
@@ -946,6 +972,7 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
@@ -1174,13 +1201,13 @@ 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.20230919091951-01618b65262e h1:ygcyhPHrwsuzJcCxDjZfGs9lU1UDstovyPLLte5oNpM=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20230919091951-01618b65262e/go.mod h1:2sgCN7nRPQL3woLfdgqLDd92vwAHqtlz3KKiHxC5BAw=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240220074040-c367f1e9972c h1:JrwRyafRs6P6IcYq1dV5HQ3KbtWQtDP3XMnHMTZjnNc=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240220074040-c367f1e9972c/go.mod h1:dsUESXIbXJ+/ywbNClhldOrbPOiBi2udrgOnB/ffoWk=
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.20240203102553-4096f103b401 h1:4l6ELFSQ0MBVInscZ8/yOtSWF0cwH5BT1ATN6dCtAqc=
yunion.io/x/jsonutils v1.0.1-0.20240203102553-4096f103b401/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=
@@ -1189,11 +1216,11 @@ yunion.io/x/ovsdb v0.0.0-20230306173834-f164f413a900 h1:Hu/4ERvoWaN6aiFs4h4/yvVB
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.20230912084455-1393f31347db h1:yxiqu3C7wDnL3M8Nn54QmBp+rRgT4k5+/E6kJPVPlco=
yunion.io/x/pkg v1.0.1-0.20230912084455-1393f31347db/go.mod h1:ksCJVQ+DwKrJ5QBEoU8pzrDFfDaZVAFH/iJ6yQCYxJk=
yunion.io/x/pkg v1.10.1-0.20240127153242-cdf9dc071f4f h1:nLMBj8S3/ev2pB1wzGSi6hOM0aMK0DS2oyuQFzHbfkI=
yunion.io/x/pkg v1.10.1-0.20240127153242-cdf9dc071f4f/go.mod h1:ksCJVQ+DwKrJ5QBEoU8pzrDFfDaZVAFH/iJ6yQCYxJk=
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.20230823191329-dc02ac3a547c h1:9R2cTcmPBUno1P2YI321nztK1Jpu7QRBNbnHsI1uX1Q=
yunion.io/x/sqlchemy v1.1.2-0.20230823191329-dc02ac3a547c/go.mod h1:uuPVZEyEq3sWd5vf9VjGSy6lZzof22X87OEHw9sddJQ=
yunion.io/x/structarg v0.0.0-20220312084958-9c6c79c7d1c6 h1:WuWXhY3DvhdRTzWCJ/kwt3Ss6KIq7+KqJwb+esvNGwU=
yunion.io/x/structarg v0.0.0-20220312084958-9c6c79c7d1c6/go.mod h1:EP6NSv2C0zzqBDTKumv8hPWLb3XvgMZDHQRfyuOrQng=
yunion.io/x/sqlchemy v1.1.3-0.20240210161427-e48bb9a658b7 h1:T/lJOFh353MbMon3k+gzGbrmTOV1a6I8/dIlrEdwV9I=
yunion.io/x/sqlchemy v1.1.3-0.20240210161427-e48bb9a658b7/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=

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -75,7 +75,7 @@ func init() {
func (man *SAnsiblePlaybookManager) ValidateCreateData(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, data *jsonutils.JSONDict) (*jsonutils.JSONDict, error) {
pbV := NewAnsiblePlaybookValidator("playbook", userCred)
if err := pbV.Validate(data); err != nil {
if err := pbV.Validate(ctx, data); err != nil {
return nil, err
}
data.Set("status", jsonutils.NewString(api.AnsiblePlaybookStatusInit))
@@ -137,7 +137,7 @@ func (apb *SAnsiblePlaybook) ValidateUpdateCondition(ctx context.Context) error
func (apb *SAnsiblePlaybook) ValidateUpdateData(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data *jsonutils.JSONDict) (*jsonutils.JSONDict, error) {
pbV := NewAnsiblePlaybookValidator("playbook", userCred)
if err := pbV.Validate(data); err != nil {
if err := pbV.Validate(ctx, data); err != nil {
return nil, err
}
apb.Playbook = pbV.Playbook // Update as a whole

View File

@@ -46,7 +46,7 @@ func NewAnsiblePlaybookValidator(key string, userCred mcclient.TokenCredential)
return v
}
func (v *ValidatorAnsiblePlaybook) Validate(data *jsonutils.JSONDict) error {
func (v *ValidatorAnsiblePlaybook) Validate(ctx context.Context, data *jsonutils.JSONDict) error {
pb := ansible.NewPlaybook()
err := data.Unmarshal(pb, "playbook")
if err != nil {

View File

@@ -656,8 +656,14 @@ func doLogout(ctx context.Context, w http.ResponseWriter, req *http.Request) {
token, _, _ := fetchAuthInfo(ctx, req)
if token != nil {
// valid login, log the event
user := logclient.NewSimpleObject(token.GetUserId(), token.GetUserName(), "user")
logclient.AddActionLogWithContext(ctx, user, logclient.ACT_LOGOUT, "", token, true)
err := auth.Remove(ctx, token.GetTokenString())
if err != nil {
log.Errorf("remove token fail %s", err)
return
} else {
user := logclient.NewSimpleObject(token.GetUserId(), token.GetUserName(), "user")
logclient.AddActionLogWithContext(ctx, user, logclient.ACT_LOGOUT, "", token, true)
}
}
clearAuthCookie(w)
appsrv.DisableClientCache(w)

View File

@@ -250,7 +250,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

@@ -83,7 +83,6 @@ func RpcHandler(ctx context.Context, w http.ResponseWriter, req *http.Request) {
return
}
token := AppContextToken(ctx)
// pathParams := appctx.AppContextParams(ctx)
s := auth.GetSession(ctx, token, FetchRegion(req))
funcname := verb + utils.Kebab2Camel(callName, "-")
mod, e := modulebase.GetModule(s, resType)
@@ -114,13 +113,14 @@ func RpcHandler(ctx context.Context, w http.ResponseWriter, req *http.Request) {
retobj := retValue[0]
reterr := retValue[1]
if reterr.IsNil() {
v, ok := retobj.Interface().(jsonutils.JSONObject)
addr := retobj.Interface()
v, ok := addr.(jsonutils.JSONObject)
if ok {
appsrv.SendJSON(w, v)
return
}
v2, ok := retobj.Interface().([]printutils.SubmitResult)
v2, ok := addr.([]printutils.SubmitResult)
if ok {
w.WriteHeader(207)
appsrv.SendJSON(w, modulebase.SubmitResults2JSON(v2))
@@ -128,13 +128,14 @@ func RpcHandler(ctx context.Context, w http.ResponseWriter, req *http.Request) {
}
httperrors.BadGatewayError(ctx, w, "recv invalid data")
} else {
ge, ok := reterr.Interface().(error)
if ok {
je := httperrors.NewGeneralError(ge)
httperrors.GeneralServerError(ctx, w, je)
return
}
httperrors.BadGatewayError(ctx, w, fmt.Sprintf("%s", reterr.Interface()))
return
}
errAddr := reterr.Interface()
ge, ok := errAddr.(error)
if ok {
je := httperrors.NewGeneralError(ge)
httperrors.GeneralServerError(ctx, w, je)
return
}
httperrors.BadGatewayError(ctx, w, fmt.Sprintf("%s", reterr.Interface()))
}

View File

@@ -16,12 +16,15 @@ package report
import (
"context"
"net"
"os"
"strings"
"time"
"yunion.io/x/jsonutils"
"yunion.io/x/log"
"yunion.io/x/pkg/errors"
"yunion.io/x/pkg/gotypes"
"yunion.io/x/pkg/util/httputils"
"yunion.io/x/pkg/util/version"
"yunion.io/x/pkg/utils"
@@ -36,33 +39,93 @@ import (
)
type sReport struct {
GenerateName string
UUID string
Version string
OsDist string
OsVersion string
QemuVersion string
CpuArchitecture string
Brands string
HostCnt int64
KvmHostCnt int64
HostCpuCnt int64
HostMemSizeMb int64
BaremetalCnt int64
BaremetalCpuCnt int64
BaremetalMemSizeMb int64
ServerCnt int64
ServerCpuCnt int64
ServerMemSizeMb int64
DiskCnt int64
DiskSizeMb int64
BucketCnt int64
RdsCnt int64
MongoDBCnt int64
KafkaCnt int64
UserCnt int64
ProjectCnt int64
DomainCnt int64
GenerateName string
UUID string
Version string
OsDist string
OsVersion string
QemuVersion string
CpuArchitecture string
Brands string
HostCnt int64
KvmHostCnt int64
VmwareHostCnt int64
HostCpuCnt int64
HostMemSizeMb int64
BaremetalCnt int64
BaremetalCpuCnt int64
BaremetalMemSizeMb int64
BaremetalStorageSizeGb int64
ServerCnt int64
ServerCpuCnt int64
ServerMemSizeMb int64
KvmServerCnt int64
KvmServerCpuCnt int64
KvmServerMemSizeMb int64
DiskCnt int64
DiskSizeMb int64
BucketCnt int64
RdsCnt int64
MongoDBCnt int64
KafkaCnt int64
UserCnt int64
ProjectCnt int64
DomainCnt int64
RunningEnv string
}
const (
RUNNING_ENV_KUBERNETES = "kubernetes"
RUNNING_ENV_DOCKER_COMPOSE = "docker-compose"
RUNNING_ENV_UNKNOWN = "unknown"
)
func isInsideDockerCompose() bool {
// hostname likes: c1577eee2aed
DOCKER_HOSTNAME_LEN := 12
hostname := os.Getenv("HOSTNAME")
if len(hostname) != DOCKER_HOSTNAME_LEN {
return false
}
// resolv mysql and keystone host
resolvTimeout := 500 * time.Millisecond
ctx, cancel := context.WithTimeout(context.Background(), resolvTimeout)
defer cancel()
var r net.Resolver
hosts := []string{"mysql", "keystone", "region"}
for _, host := range hosts {
_, err := r.LookupIPAddr(ctx, host)
if err != nil {
return false
}
}
return true
}
func isInsideKubernetes() bool {
k8sHost := os.Getenv("KUBERNETES_SERVICE_HOST")
if len(k8sHost) == 0 {
return false
}
// check /var/run/secrets/kubernetes.io/serviceaccount/ directory
k8sSecDir := "/var/run/secrets/kubernetes.io/serviceaccount/"
if _, err := os.Stat(k8sSecDir); err != nil {
return false
}
return true
}
func getRunningEnv() string {
if isInsideKubernetes() {
return RUNNING_ENV_KUBERNETES
}
if isInsideDockerCompose() {
return RUNNING_ENV_DOCKER_COMPOSE
}
return RUNNING_ENV_UNKNOWN
}
func Report(ctx context.Context, userCred mcclient.TokenCredential, isStart bool) {
@@ -83,12 +146,37 @@ func Report(ctx context.Context, userCred mcclient.TokenCredential, isStart bool
resp, err := compute.Hosts.List(s, jsonutils.Marshal(map[string]interface{}{
"scope": "system",
"hypervisor": api.HYPERVISOR_KVM,
"limit": 20,
"limit": 1,
}))
if err != nil {
return nil, errors.Wrapf(err, "Hosts.List")
}
ret.KvmHostCnt = int64(resp.Total)
resp, err = compute.Hosts.List(s, jsonutils.Marshal(map[string]interface{}{
"scope": "system",
"hypervisor": api.HYPERVISOR_ESXI,
"limit": 1,
}))
if err != nil {
return nil, errors.Wrapf(err, "Hosts.List")
}
ret.VmwareHostCnt = int64(resp.Total)
resp, err = compute.Servers.List(s, jsonutils.Marshal(map[string]interface{}{
"scope": "system",
"hypervisor": api.HYPERVISOR_KVM,
"limit": 1,
}))
if err != nil {
return nil, errors.Wrapf(err, "Server.List")
}
ret.KvmServerCnt = int64(resp.Total)
if !gotypes.IsNil(resp.Totals) {
ret.KvmServerCpuCnt, _ = resp.Totals.Int("cpu_count")
ret.KvmServerMemSizeMb, _ = resp.Totals.Int("mem_mb")
}
osDists, osVersions, qemuVersions, archs := []string{}, []string{}, []string{}, []string{}
hosts := []api.HostDetails{}
jsonutils.Update(&hosts, resp.Data)
@@ -147,6 +235,10 @@ func Report(ctx context.Context, userCred mcclient.TokenCredential, isStart bool
ret.RdsCnt, _ = usage.Int("all.rds")
ret.MongoDBCnt, _ = usage.Int("all.mongodb")
ret.KafkaCnt, _ = usage.Int("all.kafka")
ret.BaremetalCnt, _ = usage.Int("baremetals")
ret.BaremetalCpuCnt, _ = usage.Int("baremetals.cpu")
ret.BaremetalMemSizeMb, _ = usage.Int("baremetals.memory")
ret.BaremetalStorageSizeGb, _ = usage.Int("baremetals.storage_gb")
usage, err = identity.IdentityUsages.GetUsage(s, system)
if err != nil {
return nil, errors.Wrapf(err, "IdentityUsages.GetUsage")
@@ -154,6 +246,7 @@ func Report(ctx context.Context, userCred mcclient.TokenCredential, isStart bool
ret.UserCnt, _ = usage.Int("users")
ret.DomainCnt, _ = usage.Int("domains")
ret.ProjectCnt, _ = usage.Int("projects")
ret.RunningEnv = getRunningEnv()
return ret, nil
}
rp, err := func() (*sReport, error) {

View File

@@ -78,10 +78,11 @@ func GetDBModels(opts *GetDBModelsOptions) error {
}
if !opts.InCludeOtherCloudEnv() {
listOptions.Filter = append(listOptions.Filter,
"manager_id.isnullorempty()", // len(manager_id) > 0 is for pubcloud objects
"external_id.isnullorempty()", // len(external_id) > 0 is for pubcloud objects
"manager_id.isnullorempty()", // len(manager_id) > 0 is for pubcloud objects
// "external_id.isnullorempty()", // len(external_id) > 0 is for pubcloud objects
)
listOptions.CloudEnv = "onpremise"
// listOptions.Provider = []string{"OneCloud"}
}
if inter, ok := opts.GetModelSet().(IModelSetFilter); ok {
filter := inter.ModelFilter()

View File

@@ -57,50 +57,11 @@ func GetModels(opts *GetModelsOptions) error {
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) {
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{
@@ -112,7 +73,7 @@ func GetModels(opts *GetModelsOptions) error {
Filter: []string{
minUpdatedAtFilter(minUpdatedAt), // order matters, filter.0
},
OrderBy: []string{"updated_at"},
OrderBy: []string{"updated_at", "created_at", "id"},
Order: "asc",
Limit: options.Int(opts.BatchListSize),
Offset: options.Int(0),
@@ -123,6 +84,7 @@ func GetModels(opts *GetModelsOptions) error {
// "external_id.isnullorempty()", // len(external_id) > 0 is for pubcloud objects
)
listOptions.CloudEnv = "onpremise"
// listOptions.Provider = []string{"OneCloud"}
}
if inter, ok := opts.ModelSet.(IModelSetFilter); ok {
filter := inter.ModelFilter()
@@ -150,6 +112,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 +122,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)
}

View File

@@ -18,6 +18,11 @@ import (
"yunion.io/x/onecloud/pkg/util/choices"
)
const (
SERVICE_TYPE = "cloudproxy"
SERVICE_VERSION = ""
)
const (
PM_SCOPE_VPC = "vpc"
PM_SCOPE_NETWORK = "network"

View File

@@ -17,8 +17,6 @@ package compute
import "yunion.io/x/onecloud/pkg/apis"
const (
DEFAULT_ACCESS_GROUP = "default"
ACCESS_GROUP_STATUS_AVAILABLE = "available"
ACCESS_GROUP_STATUS_DELETING = "deleting"
ACCESS_GROUP_STATUS_DELETE_FAILED = "delete_failed"
@@ -30,10 +28,15 @@ const (
type AccessGroupListInput struct {
apis.StatusInfrasResourceBaseListInput
apis.ExternalizedResourceBaseListInput
ManagedResourceListInput
RegionalFilterListInput
}
type AccessGroupDetails struct {
apis.StatusInfrasResourceBaseDetails
ManagedResourceInfo
CloudregionResourceInfo
}
type AccessGroupResourceInfo struct {
@@ -51,4 +54,7 @@ type AccessGroupFilterListInput struct {
type AccessGroupCreateInput struct {
apis.StatusInfrasResourceBaseCreateInput
CloudproviderResourceInput
CloudregionResourceInput
}

View File

@@ -78,13 +78,16 @@ type NetworkConfig struct {
// 子网内的IPv6地址
// required: false
// swagger:ignore
Address6 string `json:"address6"`
// 如果是批量创建指定每台主机子网内的IPv4地址
// required: false
Addresses6 []string `json:"addresses6"`
// 是否要求分配IPv6地址
// required: false
RequireIPv6 bool `json:"require_ipv6"`
// 驱动方式
// 若指定镜像的网络驱动方式,此参数会被覆盖
Driver string `json:"driver"`
@@ -96,6 +99,8 @@ type NetworkConfig struct {
RxTrafficLimit int64 `json:"rx_traffic_limit"`
TxTrafficLimit int64 `json:"tx_traffic_limit"`
IsDefault bool `json:"is_default"`
// sriov nic
SriovDevice *IsolatedDeviceConfig `json:"sriov_device"`
@@ -118,8 +123,15 @@ type NetworkConfig struct {
type AttachNetworkInput struct {
// 添加的网卡的配置
// required: true
// required: false
Nets []*NetworkConfig `json:"nets"`
// 添加的网卡的配置
// required: false
NetDesc []string `json:"net_desc"`
// 添加后不立即同步配置
DisableSyncConfig *bool `json:"disable_sync_config"`
}
type DiskConfig struct {
@@ -256,6 +268,14 @@ type DiskConfig struct {
// NVNe device
NVMEDevice *IsolatedDeviceConfig `json:"nvme_device"`
// 预分配策略:
// off: 关闭预分配,默认关闭
// metadata: 精简置备
// falloc: 厚置备延迟置零
// full: 厚置备快速置零
// default: off
Preallocation string `json:"preallocation"`
}
type IsolatedDeviceConfig struct {
@@ -421,6 +441,11 @@ type ServerCreateInput struct {
// default: 1
VcpuCount int `json:"vcpu_count"`
// cpu卡槽数
// 目前仅vmware支持此参数
// default: 1
CpuSockets int `json:"cpu_sockets"`
// 用户自定义启动脚本
// 支持 #cloud-config yaml 格式及shell脚本
// 支持特殊user data平台: Aliyun, Qcloud, Azure, Apsara, Ucloud

View File

@@ -20,8 +20,12 @@ import (
"yunion.io/x/onecloud/pkg/apis"
)
type TBackupStorageType string
const (
BACKUPSTORAGE_TYPE_NFS = "nfs"
BACKUPSTORAGE_TYPE_NFS = TBackupStorageType("nfs")
BACKUPSTORAGE_TYPE_OBJECT_STORAGE = TBackupStorageType("object")
BACKUPSTORAGE_STATUS_ONLINE = "online"
BACKUPSTORAGE_STATUS_OFFLINE = "offline"
@@ -55,27 +59,26 @@ type BackupStorageCreateInput struct {
// enum: nfs
StorageType string `json:"storage_type"`
// description: host of nfs, storage_type 为 nfs 时, 此参数必传
// example: 192.168.222.2
NfsHost string `json:"nfs_host"`
// description: shared dir of nfs, storage_type 为 nfs 时, 此参数必传
// example: /nfs_root/
NfsSharedDir string `json:"nfs_shared_dir"`
SBackupStorageAccessInfo
// description: Capacity size in MB
CapacityMb int `json:"capacity_mb"`
}
type BackupStorageAccessInfo struct {
AccessUrl string
type BackupStorageUpdateInput struct {
apis.EnabledStatusInfrasResourceBaseUpdateInput
SBackupStorageAccessInfo
}
/*type BackupStorageAccessInfo struct {
AccessUrl string
}*/
type BackupStorageDetails struct {
apis.EnabledStatusInfrasResourceBaseDetails
NfsHost string
NfsSharedDir string
SBackupStorageAccessInfo
}
type BackupStorageListInput struct {
@@ -162,3 +165,38 @@ type InstanceBackupPackMetadata struct {
type InstanceBackupManagerSyncstatusInput struct {
}
type SBackupStorageAccessInfo struct {
// description: host of nfs, storage_type 为 nfs 时, 此参数必传
// example: 192.168.222.2
NfsHost string `json:"nfs_host"`
// description: shared dir of nfs, storage_type 为 nfs 时, 此参数必传
// example: /nfs_root/
NfsSharedDir string `json:"nfs_shared_dir"`
// description: access url of object storage bucket
// example: https://qxxxxxo.tos-cn-beijing.volces.com
ObjectBucketUrl string `json:"object_bucket_url"`
// description: access key of object storage
ObjectAccessKey string `json:"object_access_key"`
// description: secret of object storage
ObjectSecret string `json:"object_secret"`
}
func (ba *SBackupStorageAccessInfo) String() string {
return jsonutils.Marshal(ba).String()
}
func (ba *SBackupStorageAccessInfo) IsZero() bool {
return ba == nil
}
type ServerCreateInstanceBackupInput struct {
// 主机备份名称
Name string `json:"name"`
// 主机备份的生成名称
GenerateName string `json:"generate_name"`
// 备份存储ID
BackupStorageId string `json:"backup_storage_id"`
}

View File

@@ -16,10 +16,12 @@ package compute
import (
"net/http"
"reflect"
"yunion.io/x/cloudmux/pkg/apis/compute"
"yunion.io/x/cloudmux/pkg/cloudprovider"
"yunion.io/x/pkg/errors"
"yunion.io/x/pkg/gotypes"
"yunion.io/x/pkg/util/regutils"
"yunion.io/x/pkg/utils"
@@ -80,7 +82,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 {
@@ -360,3 +362,9 @@ type BucketRefererConf struct {
func (input *BucketRefererConf) Validate() error {
return nil
}
func init() {
gotypes.RegisterSerializable(reflect.TypeOf(&SBackupStorageAccessInfo{}), func() gotypes.ISerializable {
return &SBackupStorageAccessInfo{}
})
}

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

@@ -54,6 +54,7 @@ const (
CLOUD_PROVIDER_HCS = compute.CLOUD_PROVIDER_HCS
CLOUD_PROVIDER_OPENSTACK = compute.CLOUD_PROVIDER_OPENSTACK
CLOUD_PROVIDER_UCLOUD = compute.CLOUD_PROVIDER_UCLOUD
CLOUD_PROVIDER_VOLCENGINE = compute.CLOUD_PROVIDER_VOLCENGINE
CLOUD_PROVIDER_ZSTACK = compute.CLOUD_PROVIDER_ZSTACK
CLOUD_PROVIDER_GOOGLE = compute.CLOUD_PROVIDER_GOOGLE
CLOUD_PROVIDER_CTYUN = compute.CLOUD_PROVIDER_CTYUN
@@ -69,6 +70,7 @@ const (
CLOUD_PROVIDER_BAIDU = compute.CLOUD_PROVIDER_BAIDU
CLOUD_PROVIDER_CUCLOUD = compute.CLOUD_PROVIDER_CUCLOUD
CLOUD_PROVIDER_QINGCLOUD = compute.CLOUD_PROVIDER_QINGCLOUD
CLOUD_PROVIDER_ORACLE = compute.CLOUD_PROVIDER_ORACLE
CLOUD_PROVIDER_GENERICS3 = compute.CLOUD_PROVIDER_GENERICS3
CLOUD_PROVIDER_CEPH = compute.CLOUD_PROVIDER_CEPH
@@ -102,8 +104,6 @@ const (
CLOUD_ACCESS_ENV_AZURE_GERMAN = compute.CLOUD_ACCESS_ENV_AZURE_GERMAN
CLOUD_ACCESS_ENV_AZURE_US_GOVERNMENT = compute.CLOUD_ACCESS_ENV_AZURE_US_GOVERNMENT
CLOUD_ACCESS_ENV_AZURE_CHINA = compute.CLOUD_ACCESS_ENV_AZURE_CHINA
CLOUD_ACCESS_ENV_HUAWEI_GLOBAL = compute.CLOUD_ACCESS_ENV_HUAWEI_GLOBAL
CLOUD_ACCESS_ENV_HUAWEI_CHINA = compute.CLOUD_ACCESS_ENV_HUAWEI_CHINA
CLOUD_ACCESS_ENV_ALIYUN_GLOBAL = compute.CLOUD_ACCESS_ENV_ALIYUN_GLOBAL
CLOUD_ACCESS_ENV_ALIYUN_FINANCE = compute.CLOUD_ACCESS_ENV_ALIYUN_FINANCE
CLOUD_ACCESS_ENV_CTYUN_CHINA = compute.CLOUD_ACCESS_ENV_CTYUN_CHINA
@@ -119,6 +119,23 @@ 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_BAIDU,
CLOUD_PROVIDER_CTYUN,
CLOUD_PROVIDER_CUCLOUD,
CLOUD_PROVIDER_ECLOUD,
CLOUD_PROVIDER_HUAWEI,
CLOUD_PROVIDER_QCLOUD,
CLOUD_PROVIDER_UCLOUD,
CLOUD_PROVIDER_GOOGLE,
CLOUD_PROVIDER_KSYUN,
CLOUD_PROVIDER_QINGCLOUD,
CLOUD_PROVIDER_JDCLOUD,
CLOUD_PROVIDER_VOLCENGINE,
}
CLOUD_PROVIDERS = []string{
CLOUD_PROVIDER_ONECLOUD,
@@ -134,6 +151,7 @@ var (
CLOUD_PROVIDER_HCS,
CLOUD_PROVIDER_OPENSTACK,
CLOUD_PROVIDER_UCLOUD,
CLOUD_PROVIDER_VOLCENGINE,
CLOUD_PROVIDER_ZSTACK,
CLOUD_PROVIDER_GOOGLE,
CLOUD_PROVIDER_CTYUN,
@@ -150,6 +168,7 @@ var (
CLOUD_PROVIDER_BAIDU,
CLOUD_PROVIDER_CUCLOUD,
CLOUD_PROVIDER_QINGCLOUD,
CLOUD_PROVIDER_ORACLE,
}
CLOUD_PROVIDER_HOST_TYPE_MAP = map[string][]string{
@@ -194,6 +213,9 @@ var (
CLOUD_PROVIDER_UCLOUD: {
HOST_TYPE_UCLOUD,
},
CLOUD_PROVIDER_VOLCENGINE: {
HOST_TYPE_VOLCENGINE,
},
CLOUD_PROVIDER_ZSTACK: {
HOST_TYPE_ZSTACK,
},
@@ -242,6 +264,9 @@ var (
CLOUD_PROVIDER_QINGCLOUD: {
HOST_TYPE_QINGCLOUD,
},
CLOUD_PROVIDER_ORACLE: {
HOST_TYPE_ORACLE,
},
}
)
@@ -277,10 +302,6 @@ var (
"InternationalCloud": CLOUD_ACCESS_ENV_AWS_GLOBAL,
"ChinaCloud": CLOUD_ACCESS_ENV_AWS_CHINA,
},
CLOUD_PROVIDER_HUAWEI: {
"InternationalCloud": CLOUD_ACCESS_ENV_HUAWEI_GLOBAL,
"ChinaCloud": CLOUD_ACCESS_ENV_HUAWEI_CHINA,
},
CLOUD_PROVIDER_ALIYUN: {
"InternationalCloud": CLOUD_PROVIDER_ALIYUN,
"FinanceCloud": CLOUD_ACCESS_ENV_ALIYUN_FINANCE,

View File

@@ -245,6 +245,8 @@ type CloudproviderListInput struct {
ManagedResourceListInput
apis.ProjectizedResourceListInput
apis.ExternalizedResourceBaseListInput
UsableResourceListInput
CloudregionResourceInput
@@ -255,6 +257,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

@@ -325,3 +325,7 @@ type DiskResetInput struct {
SnapshotId string `json:"snapshot_id"`
AutoStart bool `json:"auto_start"`
}
type DiskSnapshotpolicyInput struct {
SnapshotpolicyId string `json:"snapshotpolicy_id"`
}

View File

@@ -64,8 +64,23 @@ const (
DISK_NOT_EXIST = "not_exist"
DISK_EXIST = "exist"
DISK_PREALLOCATION_OFF = "off"
// 精简置备
DISK_PREALLOCATION_METADATA = "metadata"
// 厚置备延迟归零
DISK_PREALLOCATION_FALLOC = "falloc"
// 厚置备快速归零
DISK_PREALLOCATION_FULL = "full"
)
var DISK_PREALLOCATIONS = []string{
DISK_PREALLOCATION_OFF,
DISK_PREALLOCATION_METADATA,
DISK_PREALLOCATION_FALLOC,
DISK_PREALLOCATION_FULL,
}
const DISK_META_EXISTING_PATH = "disk_existing_path"
const (

View File

@@ -14,11 +14,90 @@
package compute
import "yunion.io/x/onecloud/pkg/apis"
import (
"yunion.io/x/cloudmux/pkg/apis/compute"
"yunion.io/x/cloudmux/pkg/cloudprovider"
"yunion.io/x/pkg/util/regutils"
"yunion.io/x/onecloud/pkg/apis"
"yunion.io/x/onecloud/pkg/httperrors"
)
const (
DNS_RECORDSET_STATUS_AVAILABLE = compute.DNS_RECORDSET_STATUS_AVAILABLE
DNS_RECORDSET_STATUS_CREATING = apis.STATUS_CREATING
)
type DnsRecordCreateInput struct {
apis.AdminSharableVirtualResourceBaseCreateInput
apis.EnabledStatusStandaloneResourceCreateInput
DnsZoneId string `json:"dns_zone_id"`
DnsType string `json:"dns_type"`
DnsValue string `json:"dns_value"`
TTL int64 `json:"ttl"`
MxPriority int64 `json:"mx_priority"`
PolicyType string `json:"policy_type"`
PolicyValue string `json:"policy_value"`
}
type DnsRecordUpdateInput struct {
apis.EnabledStatusStandaloneResourceBaseUpdateInput
DnsType string `json:"dns_type"`
DnsValue string `json:"dns_value"`
TTL *int64 `json:"ttl"`
MxPriority *int64 `json:"mx_priority"`
}
type DnsRecordDetails struct {
apis.EnabledStatusStandaloneResourceDetails
SDnsRecord
DnsZone string `json:"dns_zone"`
}
type DnsRecordListInput struct {
apis.EnabledStatusStandaloneResourceListInput
DnsZoneFilterListBase
}
type DnsRecordEnableInput struct {
apis.PerformEnableInput
}
type DnsRecordDisableInput struct {
apis.PerformDisableInput
}
func (record *SDnsRecord) ValidateDnsrecordValue() error {
switch cloudprovider.TDnsType(record.DnsType) {
case cloudprovider.DnsTypeMX:
if record.MxPriority < 1 || record.MxPriority > 50 {
return httperrors.NewOutOfRangeError("mx_priority range limited to [1,50]")
}
if !regutils.MatchDomainName(record.DnsValue) {
return httperrors.NewInputParameterError("invalid domain %s for MX record", record.DnsValue)
}
case cloudprovider.DnsTypeA:
if !regutils.MatchIP4Addr(record.DnsValue) {
return httperrors.NewInputParameterError("invalid ipv4 %s for A record", record.DnsValue)
}
case cloudprovider.DnsTypeAAAA:
if !regutils.MatchIP6Addr(record.DnsValue) {
return httperrors.NewInputParameterError("invalid ipv6 %s for AAAA record", record.DnsValue)
}
case cloudprovider.DnsTypeCNAME:
if !regutils.MatchDomainName(record.DnsValue) {
return httperrors.NewInputParameterError("invalid domain %s for CNAME record", record.DnsValue)
}
}
return nil
}
type SDnsResolveResult struct {
DnsValue string `json:"dns_value"`
TTL int64 `json:"ttl"`
DnsName string `json:"dns_name"`
}

View File

@@ -1,100 +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 (
"regexp"
"yunion.io/x/cloudmux/pkg/apis/compute"
"yunion.io/x/cloudmux/pkg/cloudprovider"
"yunion.io/x/pkg/util/regutils"
"yunion.io/x/onecloud/pkg/apis"
"yunion.io/x/onecloud/pkg/httperrors"
)
const (
DNS_RECORDSET_STATUS_AVAILABLE = compute.DNS_RECORDSET_STATUS_AVAILABLE
DNS_RECORDSET_STATUS_CREATING = apis.STATUS_CREATING
)
type DnsRecordSetCreateInput struct {
apis.EnabledStatusStandaloneResourceCreateInput
DnsZoneId string `json:"dns_zone_id"`
DnsType string `json:"dns_type"`
DnsValue string `json:"dns_value"`
TTL int64 `json:"ttl"`
MxPriority int64 `json:"mx_priority"`
PolicyType string `json:"policy_type"`
PolicyValue string `json:"policy_value"`
}
type DnsRecordSetUpdateInput struct {
apis.EnabledStatusStandaloneResourceBaseUpdateInput
DnsType string `json:"dns_type"`
DnsValue string `json:"dns_value"`
TTL *int64 `json:"ttl"`
MxPriority *int64 `json:"mx_priority"`
}
type DnsRecordSetDetails struct {
apis.EnabledStatusStandaloneResourceDetails
SDnsRecordSet
DnsZone string `json:"dns_zone"`
}
type DnsRecordSetListInput struct {
apis.EnabledStatusStandaloneResourceListInput
DnsZoneFilterListBase
}
type DnsRecordEnableInput struct {
apis.PerformEnableInput
}
type DnsRecordDisableInput struct {
apis.PerformDisableInput
}
func (recordset *SDnsRecordSet) ValidateDnsrecordValue() error {
domainReg := regexp.MustCompile(`^(([a-zA-Z]{1})|([a-zA-Z]{1}[a-zA-Z]{1})|([a-zA-Z]{1}[0-9]{1})|([0-9]{1}[a-zA-Z]{1})|([a-zA-Z0-9][a-zA-Z0-9-_]{1,61}[a-zA-Z0-9]))\.([a-zA-Z]{2,6}|[a-zA-Z0-9-]{2,30}\.[a-zA-Z]{2,3})$`)
switch cloudprovider.TDnsType(recordset.DnsType) {
case cloudprovider.DnsTypeMX:
if recordset.MxPriority < 1 || recordset.MxPriority > 50 {
return httperrors.NewOutOfRangeError("mx_priority range limited to [1,50]")
}
if !domainReg.MatchString(recordset.DnsValue) {
return httperrors.NewInputParameterError("invalid domain %s for MX record", recordset.DnsValue)
}
case cloudprovider.DnsTypeA:
if !regutils.MatchIP4Addr(recordset.DnsValue) {
return httperrors.NewInputParameterError("invalid ipv4 %s for A record", recordset.DnsValue)
}
case cloudprovider.DnsTypeAAAA:
if !regutils.MatchIP6Addr(recordset.DnsValue) {
return httperrors.NewInputParameterError("invalid ipv6 %s for AAAA record", recordset.DnsValue)
}
case cloudprovider.DnsTypeCNAME:
if !domainReg.MatchString(recordset.DnsValue) {
return httperrors.NewInputParameterError("invalid domain %s for CNAME record", recordset.DnsValue)
}
}
return nil
}

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

@@ -33,14 +33,20 @@ type GroupnetworkListInput struct {
// IP地址
IpAddr []string `json:"ip_addr"`
// IPv6地址
Ip6Addr []string `json:"ip6_addr"`
}
type GroupAttachNetworkInput struct {
// network id or name
NetworkId string `json:"network_id" help:"The network to attach, optional"`
// candidate IPaddr
IpAddr string `json:"ip_addr" help:"The ip address to use, optional"`
// candidate IPv4 addr
IpAddr string `json:"ip_addr" help:"The ipv4 address to use, optional"`
// candidate IPv6 addr
Ip6Addr string `json:"ip6_addr" help:"The ipv6 address to use, optional"`
// Allocation direction
AllocDir IPAllocationDirection `json:"alloc_dir" help:"ip allocation direction, optional"`
@@ -50,9 +56,12 @@ type GroupAttachNetworkInput struct {
// Required Designed IP
RequireDesignatedIp *bool `json:"require_designated_ip" help:"fail if the designed ip is not available"`
// allocate ipv6 address
RequireIPv6 bool `json:"require_ipv6" help:"fail if no ipv6 address allocated"`
}
type GroupDetachNetworkInput struct {
// candidate IPaddr
// candidate IPaddr, can be either IPv4 or IPv6 address
IpAddr string `json:"ip_addr" help:"Ip address to detach, empty if detach all networks"`
}

View File

@@ -17,33 +17,40 @@ package compute
import "yunion.io/x/cloudmux/pkg/apis/compute"
const (
VM_INIT = compute.VM_INIT
VM_UNKNOWN = compute.VM_UNKNOWN
VM_SCHEDULE = "schedule"
VM_SCHEDULE_FAILED = "sched_fail"
VM_CREATE_NETWORK = "network"
VM_NETWORK_FAILED = "net_fail"
VM_DEVICE_FAILED = "dev_fail"
VM_CREATE_FAILED = compute.VM_CREATE_FAILED
VM_CREATE_DISK = "disk"
VM_DISK_FAILED = "disk_fail"
VM_IMAGE_CACHING = "image_caching" // 缓存镜像中
VM_START_DEPLOY = "start_deploy"
VM_DEPLOYING = compute.VM_DEPLOYING
VM_DEPLOY_FAILED = compute.VM_DEPLOY_FAILED
VM_READY = compute.VM_READY
VM_START_START = compute.VM_START_START
VM_STARTING = compute.VM_STARTING
VM_START_FAILED = "start_fail" // # = ready
VM_RUNNING = compute.VM_RUNNING
VM_START_STOP = compute.VM_START_STOP
VM_STOPPING = compute.VM_STOPPING
VM_STOP_FAILED = "stop_fail" // # = running
VM_RENEWING = "renewing"
VM_RENEW_FAILED = "renew_failed"
VM_ATTACH_DISK = "attach_disk"
VM_DETACH_DISK = "detach_disk"
VM_UNSYNC = "unsync"
VM_INIT = compute.VM_INIT
VM_UNKNOWN = compute.VM_UNKNOWN
VM_SCHEDULE = "schedule"
VM_SCHEDULE_FAILED = "sched_fail"
VM_CREATE_NETWORK = "network"
VM_NETWORK_FAILED = "net_fail"
VM_DEVICE_FAILED = "dev_fail"
VM_CREATE_FAILED = compute.VM_CREATE_FAILED
VM_CREATE_DISK = "disk"
VM_DISK_FAILED = "disk_fail"
VM_SECURITY_GROUP_FAILED = "security_group_fail"
VM_IMAGE_CACHING = "image_caching" // 缓存镜像中
VM_START_DEPLOY = "start_deploy"
VM_DEPLOYING = compute.VM_DEPLOYING
VM_DEPLOY_FAILED = compute.VM_DEPLOY_FAILED
VM_READY = compute.VM_READY
VM_START_START = compute.VM_START_START
VM_STARTING = compute.VM_STARTING
VM_START_FAILED = "start_fail" // # = ready
VM_RUNNING = compute.VM_RUNNING
VM_START_STOP = compute.VM_START_STOP
VM_STOPPING = compute.VM_STOPPING
VM_STOP_FAILED = "stop_fail" // # = running
VM_RENEWING = "renewing"
VM_RENEW_FAILED = "renew_failed"
VM_ATTACH_DISK = "attach_disk"
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"
@@ -166,6 +173,10 @@ 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"
SHUTDOWN_STOP = "stop"
SHUTDOWN_TERMINATE = "terminate"
@@ -188,6 +199,7 @@ const (
HYPERVISOR_HCSOP = compute.HYPERVISOR_HCSOP
HYPERVISOR_OPENSTACK = compute.HYPERVISOR_OPENSTACK
HYPERVISOR_UCLOUD = compute.HYPERVISOR_UCLOUD
HYPERVISOR_VOLCENGINE = compute.HYPERVISOR_VOLCENGINE
HYPERVISOR_ZSTACK = compute.HYPERVISOR_ZSTACK
HYPERVISOR_GOOGLE = compute.HYPERVISOR_GOOGLE
HYPERVISOR_CTYUN = compute.HYPERVISOR_CTYUN
@@ -204,6 +216,7 @@ const (
HYPERVISOR_BAIDU = compute.HYPERVISOR_BAIDU
HYPERVISOR_CUCLOUD = compute.HYPERVISOR_CUCLOUD
HYPERVISOR_QINGCLOUD = compute.HYPERVISOR_QINGCLOUD
HYPERVISOR_ORACLE = compute.HYPERVISOR_ORACLE
// HYPERVISOR_DEFAULT = HYPERVISOR_KVM
HYPERVISOR_DEFAULT = HYPERVISOR_KVM
@@ -265,6 +278,7 @@ var HYPERVISORS = []string{
HYPERVISOR_HCSOP,
HYPERVISOR_OPENSTACK,
HYPERVISOR_UCLOUD,
HYPERVISOR_VOLCENGINE,
HYPERVISOR_ZSTACK,
HYPERVISOR_GOOGLE,
HYPERVISOR_CTYUN,
@@ -281,6 +295,7 @@ var HYPERVISORS = []string{
HYPERVISOR_BAIDU,
HYPERVISOR_CUCLOUD,
HYPERVISOR_QINGCLOUD,
HYPERVISOR_ORACLE,
}
var ONECLOUD_HYPERVISORS = []string{
@@ -296,6 +311,7 @@ var PUBLIC_CLOUD_HYPERVISORS = []string{
HYPERVISOR_QCLOUD,
HYPERVISOR_HUAWEI,
HYPERVISOR_UCLOUD,
HYPERVISOR_VOLCENGINE,
HYPERVISOR_GOOGLE,
HYPERVISOR_CTYUN,
HYPERVISOR_ECLOUD,
@@ -304,6 +320,7 @@ var PUBLIC_CLOUD_HYPERVISORS = []string{
HYPERVISOR_BAIDU,
HYPERVISOR_CUCLOUD,
HYPERVISOR_QINGCLOUD,
HYPERVISOR_ORACLE,
}
var PRIVATE_CLOUD_HYPERVISORS = []string{
@@ -340,6 +357,7 @@ var HYPERVISOR_HOSTTYPE = map[string]string{
HYPERVISOR_HCS: HOST_TYPE_HCS,
HYPERVISOR_OPENSTACK: HOST_TYPE_OPENSTACK,
HYPERVISOR_UCLOUD: HOST_TYPE_UCLOUD,
HYPERVISOR_VOLCENGINE: HOST_TYPE_VOLCENGINE,
HYPERVISOR_ZSTACK: HOST_TYPE_ZSTACK,
HYPERVISOR_GOOGLE: HOST_TYPE_GOOGLE,
HYPERVISOR_CTYUN: HOST_TYPE_CTYUN,
@@ -356,6 +374,7 @@ var HYPERVISOR_HOSTTYPE = map[string]string{
HYPERVISOR_BAIDU: HOST_TYPE_BAIDU,
HYPERVISOR_CUCLOUD: HOST_TYPE_CUCLOUD,
HYPERVISOR_QINGCLOUD: HOST_TYPE_QINGCLOUD,
HYPERVISOR_ORACLE: HOST_TYPE_ORACLE,
}
var HOSTTYPE_HYPERVISOR = map[string]string{
@@ -374,6 +393,7 @@ var HOSTTYPE_HYPERVISOR = map[string]string{
HOST_TYPE_HCS: HYPERVISOR_HCS,
HOST_TYPE_OPENSTACK: HYPERVISOR_OPENSTACK,
HOST_TYPE_UCLOUD: HYPERVISOR_UCLOUD,
HOST_TYPE_VOLCENGINE: HYPERVISOR_VOLCENGINE,
HOST_TYPE_ZSTACK: HYPERVISOR_ZSTACK,
HOST_TYPE_GOOGLE: HYPERVISOR_GOOGLE,
HOST_TYPE_CTYUN: HYPERVISOR_CTYUN,
@@ -390,6 +410,7 @@ var HOSTTYPE_HYPERVISOR = map[string]string{
HOST_TYPE_BAIDU: HYPERVISOR_BAIDU,
HOST_TYPE_CUCLOUD: HYPERVISOR_CUCLOUD,
HOST_TYPE_QINGCLOUD: HYPERVISOR_QINGCLOUD,
HOST_TYPE_ORACLE: HYPERVISOR_ORACLE,
}
const (
@@ -413,6 +434,10 @@ const (
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"
)
func Hypervisors2HostTypes(hypervisors []string) []string {

View File

@@ -68,30 +68,29 @@ type GuestdiskUpdateInput struct {
}
type GuestdiskJsonDesc struct {
DiskId string `json:"disk_id"`
Driver string `json:"driver"`
CacheMode string `json:"cache_mode"`
AioMode string `json:"aio_mode"`
Iops int `json:"iops"`
Throughput int `json:"throughput"`
Bps int `json:"bps"`
Size int `json:"size"`
TemplateId string `json:"template_id"`
ImagePath string `json:"image_path"`
StorageId string `json:"storage_id"`
StorageType string `json:"storage_type"`
Migrating bool `json:"migrating"`
Path string `json:"path"`
Format string `json:"format"`
Index int8 `json:"index"`
BootIndex *int8 `json:"boot_index"`
MergeSnapshot bool `json:"merge_snapshot"`
EsxiFlatFilePath string `json:"esxi_flat_file_path"`
Fs string `json:"fs"`
Mountpoint string `json:"mountpoint"`
Dev string `json:"dev"`
IsSSD bool `json:"is_ssd"`
NumQueues uint8 `json:"num_queues"`
DiskId string `json:"disk_id"`
Driver string `json:"driver"`
CacheMode string `json:"cache_mode"`
AioMode string `json:"aio_mode"`
Iops int `json:"iops"`
Throughput int `json:"throughput"`
Bps int `json:"bps"`
Size int `json:"size"`
TemplateId string `json:"template_id"`
ImagePath string `json:"image_path"`
StorageId string `json:"storage_id"`
StorageType string `json:"storage_type"`
Migrating bool `json:"migrating"`
Path string `json:"path"`
Format string `json:"format"`
Index int8 `json:"index"`
BootIndex *int8 `json:"boot_index"`
MergeSnapshot bool `json:"merge_snapshot"`
Fs string `json:"fs"`
Mountpoint string `json:"mountpoint"`
Dev string `json:"dev"`
IsSSD bool `json:"is_ssd"`
NumQueues uint8 `json:"num_queues"`
// esxi
ImageInfo struct {
@@ -99,8 +98,10 @@ type GuestdiskJsonDesc struct {
ImageExternalId string `json:"image_external_id"`
StorageCacheHostIp string `json:"storage_cache_host_ip"`
} `json:"image_info"`
Preallocation string `json:"preallocation"`
TargetStorageId string `json:"target_storage_id"`
Url string `json:"url"`
EsxiFlatFilePath string `json:"esxi_flat_file_path"`
Url string `json:"url"`
}

View File

@@ -15,9 +15,10 @@
package compute
const (
SERVER_META_CONVERT_FROM_ESXI = "__server_convert_from_esxi"
SERVER_META_CONVERTED_SERVER = "__server_converted_to"
DISK_META_ESXI_FLAT_FILE_PATH = "__esxi_flat_file_path"
SERVER_META_CONVERT_FROM_ESXI = "__server_convert_from_esxi"
SERVER_META_CONVERT_FROM_CLOUDPODS = "__server_convert_from_cloudpods"
SERVER_META_CONVERTED_SERVER = "__server_converted_to"
DISK_META_REMOTE_ACCESS_PATH = "__remote_access_path"
)
type SImportNic struct {

View File

@@ -12,4 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package credentials // import "yunion.io/x/cloudmux/pkg/multicloud/huawei/client/auth/credentials"
package compute
// Rescue constants are used for rescue mode
const (
GUEST_RESCUE_INITRAMFS = "initramfs"
GUEST_RESCUE_KERNEL = "kernel"
)

View File

@@ -51,6 +51,8 @@ type GuestnetworkShortDesc struct {
VpcId string `json:"vpc_id"`
// 所属Network
NetworkId string `json:"network_id"`
// 附属IP
SubIps string `json:"sub_ips"`
}
type GuestnetworkListInput struct {
@@ -79,6 +81,8 @@ type GuestnetworkUpdateInput struct {
BwLimit *int `json:"bw_limit"`
Index *int8 `json:"index"`
IsDefault *bool `json:"is_default"`
}
type GuestnetworkBaseDesc struct {
@@ -100,6 +104,14 @@ type GuestnetworkBaseDesc struct {
Index int8 `json:"index"`
RxTrafficLimit int64 `json:"rx_traffic_limit"`
TxTrafficLimit int64 `json:"tx_traffic_limit"`
NicType compute.TNicType `json:"nic_type"`
Ip6 string `json:"ip6"`
Gateway6 string `json:"gateway6"`
Masklen6 uint8 `json:"masklen6"`
// 是否为缺省路由网关
IsDefault bool `json:"is_default"`
Bridge string `json:"bridge"`
WireId string `json:"wire_id"`
@@ -112,6 +124,8 @@ type GuestnetworkBaseDesc struct {
} `json:"vpc"`
Networkaddresses jsonutils.JSONObject `json:"networkaddresses"`
VirtualIps []string `json:"virtual_ips"`
}
type GuestnetworkJsonDesc struct {
@@ -121,10 +135,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"`
@@ -133,12 +146,12 @@ type GuestnetworkJsonDesc struct {
Rate int `json:"rate"`
BaremetalId string `json:"baremetal_id"`
NicType compute.TNicType `json:"nic_type"`
LinkUp bool `json:"link_up"`
}
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"`
}
@@ -144,13 +147,17 @@ type ServerRebuildRootInput struct {
// required: true
ImageId string `json:"image_id"`
// swagger: ignore
Keypair string `json:"keypair" yunion-deprecated-by:"keypair_id"`
// Keypair string `json:"keypair" yunion-deprecated-by:"keypair_id"`
// 秘钥Id
KeypairId string `json:"keypair_id"`
ResetPassword *bool `json:"reset_password"`
Password string `json:"password"`
AutoStart *bool `json:"auto_start"`
AllDisks *bool `json:"all_disks"`
// KeypairId string `json:"keypair_id"`
// ResetPassword *bool `json:"reset_password"`
// Password string `json:"password"`
AutoStart *bool `json:"auto_start"`
AllDisks *bool `json:"all_disks"`
ServerDeployInputBase
}
type ServerResumeInput struct {
@@ -222,6 +229,8 @@ type ServerDetails struct {
Macs string `json:"macs"`
// 网卡信息
Nics []GuestnetworkShortDesc `json:"nics"`
// 附属IP
SubIPs []string `json:"sub_ips"`
// 归属VPC
Vpc string `json:"vpc"`
@@ -246,7 +255,9 @@ type ServerDetails struct {
// 直通设备GPU列表
IsolatedDevices []SIsolatedDevice `json:"isolated_devices"`
// 是否支持GPU
IsGpu bool `json:"is_gpu"`
IsGpu bool `json:"is_gpu"`
GpuModel string `json:"gpu_model"`
GpuCount string `json:"gpu_count"`
// Cdrom信息
Cdrom []Cdrom `json:"cdrom"`
@@ -275,6 +286,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,
@@ -303,15 +330,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 {
@@ -325,24 +345,25 @@ func (self ServerDetails) GetMetricPairs() map[string]string {
// GuestDiskInfo describe the information of disk on the guest.
type GuestDiskInfo struct {
Id string `json:"id"`
Name string `json:"name"`
FsFormat string `json:"fs,omitempty"`
DiskType string `json:"disk_type"`
Index int8 `json:"index"`
BootIndex int8 `json:"boot_index"`
SizeMb int `json:"size"`
DiskFormat string `json:"disk_format"`
Driver string `json:"driver"`
CacheMode string `json:"cache_mode"`
AioMode string `json:"aio_mode"`
MediumType string `json:"medium_type"`
StorageType string `json:"storage_type"`
Iops int `json:"iops"`
Bps int `json:"bps"`
ImageId string `json:"image_id,omitempty"`
Image string `json:"image,omitemtpy"`
StorageId string `json:"storage_id"`
Id string `json:"id"`
Name string `json:"name"`
FsFormat string `json:"fs,omitempty"`
DiskType string `json:"disk_type"`
Index int8 `json:"index"`
BootIndex int8 `json:"boot_index"`
SizeMb int `json:"size"`
DiskFormat string `json:"disk_format"`
Driver string `json:"driver"`
CacheMode string `json:"cache_mode"`
AioMode string `json:"aio_mode"`
MediumType string `json:"medium_type"`
StorageType string `json:"storage_type"`
Iops int `json:"iops"`
Bps int `json:"bps"`
ImageId string `json:"image_id,omitempty"`
Image string `json:"image,omitemtpy"`
StorageId string `json:"storage_id"`
Preallocation string `json:"preallocation"`
}
func (self GuestDiskInfo) ShortDesc() string {
@@ -438,13 +459,16 @@ type GuestAutoRenewInput struct {
Duration string `json:"duration"`
}
type ConvertEsxiToKvmInput struct {
type ConvertToKvmInput struct {
apis.Meta
// target hypervisor
TargetHypervisor string `json:"target_hypervisor"`
// 指定转换的宿主机
PreferHost string `json:"prefer_host"`
// dest guest network configs
Networks []*NetworkConfig `json:"networks"`
}
type GuestSaveToTemplateInput struct {
@@ -655,6 +679,14 @@ type ServerDetachnetworkInput struct {
IpAddr string `json:"ip_addr"`
// 通过Mac解绑网卡, 优先级低于ip_addr
Mac string `json:"mac"`
// 解绑后不立即同步配置
DisableSyncConfig *bool `json:"disable_sync_config"`
// 强制卸载,无论虚拟机的状态,仅更新数据库
Force *bool `json:"force"`
}
func (input ServerDetachnetworkInput) IsForce() bool {
return input.Force != nil && *input.Force
}
type ServerMigrateForecastInput struct {
@@ -687,6 +719,15 @@ type ServerMigrateNetworkInput struct {
type ServerDeployInput struct {
apis.Meta
ServerDeployInputBase
// 部署完成后是否自动启动
// 若虚拟机重置密码后需要重启生效并且当前虚拟机状态为running, 此参数默认为true
// 若虚拟机状态为ready, 指定此参数后,部署完成后,虚拟机会自动启动
AutoStart bool `json:"auto_start"`
}
type ServerDeployInputBase struct {
// swagger: ignore
Keypair string `json:"keypair" yunion-deprecated-by:"keypair_id"`
// 秘钥Id
@@ -701,10 +742,7 @@ type ServerDeployInput struct {
ResetPassword bool `json:"reset_password"`
// 重置指定密码
Password string `json:"password"`
// 部署完成后是否自动启动
// 若虚拟机重置密码后需要重启生效并且当前虚拟机状态为running, 此参数默认为true
// 若虚拟机状态为ready, 指定此参数后,部署完成后,虚拟机会自动启动
AutoStart bool `json:"auto_start"`
// swagger: ignore
Restart bool `json:"restart"`
@@ -741,15 +779,24 @@ type ServerChangeConfigInput struct {
// swagger: ignore
Flavor string `json:"flavor" yunion-deprecated-by:"instance_type"`
// cpu卡槽数
// vmware 若开机调整配置时,需要保证调整前及调整后 vcpu_count / cpu_sockets 保持不变
// vmware开机调整配置同样需要注意 https://kb.vmware.com/s/article/2008405
CpuSockets *int `json:"cpu_sockets"`
// cpu大小
VcpuCount int `json:"vcpu_count"`
VcpuCount *int `json:"vcpu_count"`
// 内存大小, 1024M, 1G
VmemSize string `json:"vmem_size"`
// 调整完配置后是否自动启动
AutoStart bool `json:"auto_start"`
// disks start from index 1, i.e. cannot change size of system disk(1st disk)
Disks []DiskConfig `json:"disks"`
SetTrafficLimits []ServerNicTrafficLimit
ResetTrafficLimits []ServerNicTrafficLimit
}
type ServerUpdateInput struct {
@@ -783,6 +830,7 @@ type GuestJsonDesc struct {
Description string `json:"description"`
UUID string `json:"uuid"`
Mem int `json:"mem"`
CpuSockets int `json:"cpu_sockets"`
Cpu int `json:"cpu"`
Vga string `json:"vga"`
Vdi string `json:"vdi"`
@@ -850,6 +898,8 @@ type GuestJsonDesc struct {
EncryptKeyId string `json:"encrypt_key_id,omitempty"`
IsDaemon bool `json:"is_daemon"`
LightMode bool `json:"light_mode"`
}
type ServerSetBootIndexInput struct {
@@ -975,6 +1025,58 @@ type ServerGetCPUSetCoresResp struct {
HostUsedCores []int `json:"host_used_cores"`
}
type ServerGetHardwareInfoInput struct{}
type ServerHardwareInfoMotherboard struct {
Manufacturer string `json:"manufacturer"`
Model string `json:"model"`
OemName string `json:"oem_name"`
SN string `json:"sn"`
Version string `json:"version"`
}
type ServerHardwareInfoCPU struct {
Model string `json:"model"`
Count int `json:"count"`
}
type ServerHardwareInfoMemory struct {
SizeMB int `json:"size_mb"`
}
type ServerHardwareInfoDisk struct {
Id string `json:"id"`
StorageId string `json:"storage_id"`
Model string `json:"model"`
SizeMB int `json:"size_mb"`
// Disk's backend bandwidth. The unit is MB/s
Bandwidth float64 `json:"bandwidth"`
}
type ServerHardwareInfoGPUPCIEInfo struct {
Throughput string `json:"pcie_throughput"`
LaneWidth int `json:"pcie_lane_width"`
}
type ServerHardwareInfoGPU struct {
*IsolatedDeviceModelHardwareInfo
// isolate device id
Id string `json:"id"`
// GPU model name
Model string `json:"model"`
// PCIE information
PCIEInfo *IsolatedDevicePCIEInfo `json:"pcie_info"`
}
type ServerGetHardwareInfoResp struct {
Motherboard *ServerHardwareInfoMotherboard `json:"motherboard"`
CPU *ServerHardwareInfoCPU `json:"cpu"`
Memory *ServerHardwareInfoMemory `json:"memory"`
Disks []*ServerHardwareInfoDisk `json:"disk"`
GPUs []*ServerHardwareInfoGPU `json:"gpu"`
}
type ServerMonitorInput struct {
COMMAND string
QMP bool
@@ -985,11 +1087,46 @@ type ServerQemuInfo struct {
Cmdline string `json:"cmdline"`
}
type IPAddress struct {
IPAddress string `json:"ip-address"`
IPAddressType string `json:"ip-address-type"`
Prefix int `json:"prefix"`
}
type IfnameDetail struct {
HardwareAddress string `json:"hardware-address"`
IPAddresses []IPAddress `json:"ip-addresses"`
Name string `json:"name"`
Statistics struct {
RxBytes int `json:"rx-bytes"`
RxDropped int `json:"rx-dropped"`
RxErrs int `json:"rx-errs"`
RxPackets int `json:"rx-packets"`
TxBytes int `json:"tx-bytes"`
TxDropped int `json:"tx-dropped"`
TxErrs int `json:"tx-errs"`
TxPackets int `json:"tx-packets"`
} `json:"statistics"`
}
type ServerQgaSetPasswordInput struct {
Username string
Password string
}
type ServerQgaGuestInfoTaskInput struct {
}
type ServerQgaSetNetworkInput struct {
ServerQgaTimeoutInput
Device string
Ipmask string
Gateway string
}
type ServerQgaGetNetworkInput struct {
}
type ServerQgaTimeoutInput struct {
// qga execute timeout millisecond
Timeout int
@@ -1031,8 +1168,8 @@ type ServerNicTrafficLimit struct {
}
type GuestAddSubIpsInput struct {
Mac string `json:"mac"`
IpAddr string `json:"ip_addr"`
ServerNetworkInfo
Count int `json:"count"`
SubIps []string `json:"sub_ips"`
@@ -1048,3 +1185,123 @@ type NetworkAddrConf struct {
Masklen int `json:"masklen"`
Gateway string `json:"gateway"`
}
type ServerLoginInfoInput struct {
PrivateKey string `json:"private_key"`
}
type ServerLoginInfoOutput struct {
Username string `json:"username"`
Updated string `json:"updated"`
LoginKey string `json:"login_key"`
Keypair string `json:"keypair"`
Password string `json:"password"`
}
type GuestPerformStartInput struct {
// 指定启动虚拟机的Qemu版本可选值2.12.1, 4.2.0
// 仅适用于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"`
}
type ServerNetworkInfo struct {
Index int `json:"index"`
Mac string `json:"mac"`
IpAddr string `json:"ip_addr"`
Ip6Addr string `json:"ip6_addr"`
}
type ServerChangeIpaddrInput struct {
ServerNetworkInfo
NetDesc string `json:"net_desc"`
NetConf *NetworkConfig `json:"net_conf"`
Reserve *bool `json:"reserve"`
RestartNetwork *bool `json:"restart_network"`
}
type ServerChangeBandwidthInput struct {
ServerNetworkInfo
Bandwidth int `json:"bandwidth"`
}
type ServerChangeConfigSpecs struct {
CpuSockets int `json:"cpu_sockets"`
VcpuCount int `json:"vcpu_count"`
VmemSize int `json:"vmem_size"`
InstanceType string `json:"instance_type"`
}
type DiskResizeSpec struct {
DiskId string
SizeMb int
OldSizeMb int
}
type ServerChangeConfigSettings struct {
Old ServerChangeConfigSpecs `json:"old"`
ServerChangeConfigSpecs
InstanceTypeFamily string `json:"instance_type_family"`
// disks to resize
Resize []*DiskResizeSpec `json:"resize"`
// disks to create
Create []*DiskConfig `json:"create"`
AutoStart bool `json:"auto_start"`
GuestOnline bool `json:"guest_online"`
SetTrafficLimits []ServerNicTrafficLimit `json:"set_traffic_limits"`
ResetTrafficLimits []ServerNicTrafficLimit `json:"reset_traffic_limits"`
SchedDesc jsonutils.JSONObject `json:"sched_desc"`
}
func (conf ServerChangeConfigSettings) CpuChanged() bool {
return conf.VcpuCount != conf.Old.VcpuCount
}
func (conf ServerChangeConfigSettings) AddedCpu() int {
addCpu := conf.VcpuCount - conf.Old.VcpuCount
if addCpu < 0 {
addCpu = 0
}
return addCpu
}
func (conf ServerChangeConfigSettings) MemChanged() bool {
return conf.VmemSize != conf.Old.VmemSize
}
func (conf ServerChangeConfigSettings) AddedMem() int {
addMem := conf.VmemSize - conf.Old.VmemSize
if addMem < 0 {
addMem = 0
}
return addMem
}
func (conf ServerChangeConfigSettings) AddedDisk() int {
var size int
for _, resize := range conf.Resize {
size += resize.SizeMb - resize.OldSizeMb
}
for _, create := range conf.Create {
size += create.SizeMb
}
return size
}

View File

@@ -101,8 +101,10 @@ type HostListInput struct {
CpuCount []int `json:"cpu_count"`
// 内存大小,单位Mb
MemSize []int `json:"mem_size"`
// 存储类型
// 存储类型(磁盘类型sdd, rotate, hybrid)
StorageType []string `json:"storage_type"`
// 宿主机绑定存储类型
HostStorageType []string `json:"host_storage_type"`
// IPMI地址
IpmiIp []string `json:"ipmi_ip"`
// 宿主机状态
@@ -174,6 +176,9 @@ type HostDetails struct {
// 云主机数量
// example: 10
Guests int `json:"guests,allowempty"`
// 主备云主机数量
// example: 10
BackupGuests int `json:"backup_guests,allowempty"`
// 非系统云主机数量
// example: 0
NonsystemGuests int `json:"nonsystem_guests,allowempty"`
@@ -253,7 +258,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 {
@@ -500,6 +506,8 @@ type HostUpdateInput struct {
// 主机启动模式, 可能值位PXE和ISO
BootMode string `json:"boot_mode"`
EnableNumaAllocate *bool `json:"enable_numa_allocate"`
}
type HostOfflineInput struct {
@@ -613,3 +621,15 @@ type HostError struct {
type HostSyncErrorsInput struct {
HostErrors []HostError
}
type HostLoginInfoInput struct {
}
type HostLoginInfoOutput struct {
Ip string `json:"ip"`
Username string `json:"username"`
Password string `json:"password"`
}
type HostPerformStartInput struct {
}

View File

@@ -38,6 +38,7 @@ const (
HOST_TYPE_HCS = compute.HOST_TYPE_HCS
HOST_TYPE_OPENSTACK = compute.HOST_TYPE_OPENSTACK
HOST_TYPE_UCLOUD = compute.HOST_TYPE_UCLOUD
HOST_TYPE_VOLCENGINE = compute.HOST_TYPE_VOLCENGINE
HOST_TYPE_ZSTACK = compute.HOST_TYPE_ZSTACK
HOST_TYPE_GOOGLE = compute.HOST_TYPE_GOOGLE
HOST_TYPE_CTYUN = compute.HOST_TYPE_CTYUN
@@ -54,6 +55,7 @@ const (
HOST_TYPE_BAIDU = compute.HOST_TYPE_BAIDU
HOST_TYPE_CUCLOUD = compute.HOST_TYPE_CUCLOUD
HOST_TYPE_QINGCLOUD = compute.HOST_TYPE_QINGCLOUD
HOST_TYPE_ORACLE = compute.HOST_TYPE_ORACLE
HOST_TYPE_DEFAULT = HOST_TYPE_HYPERVISOR
@@ -63,9 +65,10 @@ const (
HOST_OFFLINE = compute.HOST_OFFLINE
HOST_DISABLED = "offline"
NIC_TYPE_IPMI = compute.NIC_TYPE_IPMI
NIC_TYPE_ADMIN = compute.NIC_TYPE_ADMIN
NIC_TYPE_NORMAL = compute.NIC_TYPE_NORMAL
NIC_TYPE_IPMI = compute.NIC_TYPE_IPMI
NIC_TYPE_ADMIN = compute.NIC_TYPE_ADMIN
NIC_TYPE_NORMAL = compute.NIC_TYPE_NORMAL
NIC_TYPE_INFINIBAND = compute.TNicType("infiniband")
BAREMETAL_INIT = "init"
BAREMETAL_PREPARE = "prepare"
@@ -133,6 +136,7 @@ var HOST_TYPES = []string{
HOST_TYPE_HCSOP,
HOST_TYPE_OPENSTACK,
HOST_TYPE_UCLOUD,
HOST_TYPE_VOLCENGINE,
HOST_TYPE_ZSTACK,
HOST_TYPE_CTYUN,
HOST_TYPE_GOOGLE,
@@ -148,6 +152,7 @@ var HOST_TYPES = []string{
HOST_TYPE_BAIDU,
HOST_TYPE_CUCLOUD,
HOST_TYPE_QINGCLOUD,
HOST_TYPE_ORACLE,
}
var ALL_NIC_TYPES = []compute.TNicType{NIC_TYPE_IPMI, NIC_TYPE_ADMIN, NIC_TYPE_NORMAL}

View File

@@ -17,7 +17,7 @@ package compute
type HostwireDetails struct {
HostJointResourceDetails
SHostwire
SHostwireDeprecated
// 二层网络名称
Wire string `json:"wire"`

View File

@@ -123,10 +123,6 @@ type BaremetalagentListInput struct {
AgentType []string `json:"agent_type"`
}
type DnsRecordListInput struct {
apis.AdminSharableVirtualResourceListInput
}
type DynamicschedtagListInput struct {
apis.StandaloneResourceListInput
SchedtagFilterListInput
@@ -162,18 +158,13 @@ type ServiceCatalogListInput struct {
type SnapshotPolicyListInput struct {
apis.VirtualResourceListInput
apis.ExternalizedResourceBaseListInput
ManagedResourceListInput
RegionalFilterListInput
// 按绑定的磁盘数量排序
// pattern:asc|desc
OrderByBindDiskCount string `json:"order_by_bind_disk_count"`
// 是否启用?
IsActivated *bool `json:"is_activated"`
}
type DnsRecordDetails struct {
apis.AdminSharableVirtualResourceDetails
SDnsRecord
}
type HostnameInput struct {

View File

@@ -14,7 +14,14 @@
package compute
import "yunion.io/x/onecloud/pkg/apis"
import (
"fmt"
"yunion.io/x/jsonutils"
"yunion.io/x/pkg/errors"
"yunion.io/x/onecloud/pkg/apis"
)
type IsolateDeviceDetails struct {
apis.StandaloneResourceDetails
@@ -84,6 +91,8 @@ type IsolatedDeviceCreateInput struct {
// 设备VendorId
VendorDeviceId string `json:"vendor_device_id"`
// PCIE information
PCIEInfo *IsolatedDevicePCIEInfo `json:"pcie_info"`
}
type IsolatedDeviceReservedResourceInput struct {
@@ -101,6 +110,8 @@ type IsolatedDeviceUpdateInput struct {
apis.StandaloneResourceBaseUpdateInput
IsolatedDeviceReservedResourceInput
DevType string `json:"dev_type"`
// PCIE information
PCIEInfo *IsolatedDevicePCIEInfo `json:"pcie_info"`
}
type IsolatedDeviceJsonDesc struct {
@@ -111,10 +122,12 @@ type IsolatedDeviceJsonDesc struct {
VendorDeviceId string `json:"vendor_device_id"`
Vendor string `json:"vendor"`
NetworkIndex int8 `json:"network_index"`
IsInfinibandNic bool `json:"is_infiniband_nic"`
OvsOffloadInterface string `json:"ovs_offload_interface"`
DiskIndex int8 `json:"disk_index"`
NvmeSizeMB int `json:"nvme_size_mb"`
MdevId string `json:"mdev_id"`
NumaNode int8 `json:"numa_node"`
}
type IsolatedDeviceModelCreateInput struct {
@@ -178,3 +191,137 @@ type IsolatedDeviceModelListInput struct {
// 支持热插拔 HotPluggable
HotPluggable bool `json:"hot_pluggable"`
}
type IsolatedDeviceModelHardwareInfo struct {
// GPU memory size
MemoryMB int `json:"memory_mb" help:"Memory size MB of the device"`
// GPU bandwidth. The unit is GB/s
Bandwidth float64 `json:"bandwidth" help:"Bandwidth of the device, and the unit is GB/s"`
// TFLOPS stands for number of floating point operations per second.
TFLOPS float64 `json:"tflops" help:"TFLOPS of the device, which standing for number of floating point operations per second"`
}
type IsolatedDevicePCIEInfo struct {
// Transder rate per lane
// Transfer rate refers to the encoded serial bit rate; 2.5 GT/s means 2.5 Gbit/s serial data rate.
TransferRatePerLane string `json:"transfer_rate_per_lane"`
// Lane width
LaneWidth int `json:"lane_width,omitzero"`
// The following attributes are calculated by TransferRatePerLane and LaneWidth
// Throughput indicates the unencoded bandwidth (without 8b/10b, 128b/130b, or 242B/256B encoding overhead).
// The PCIe 1.0 transfer rate of 2.5 GT/s per lane means a 2.5 Gbit/s serial bit rate corresponding to a throughput of 2.0 Gbit/s or 250 MB/s prior to 8b/10b encoding.
Throughput string `json:"throughput"`
// Version is the PCIE version
Version string `json:"version"`
}
func NewIsolatedDevicePCIEInfo(transferRate string, laneWidth int) (*IsolatedDevicePCIEInfo, error) {
info := &IsolatedDevicePCIEInfo{
TransferRatePerLane: transferRate,
LaneWidth: laneWidth,
}
if err := info.fillData(); err != nil {
return info, errors.Wrap(err, "fillData")
}
return info, nil
}
func (info *IsolatedDevicePCIEInfo) String() string {
return jsonutils.Marshal(info).String()
}
func (info *IsolatedDevicePCIEInfo) IsZero() bool {
if *info == (IsolatedDevicePCIEInfo{}) {
return true
}
return false
}
const (
PCIEVersion1 = "1.0"
PCIEVersion2 = "2.0"
PCIEVersion3 = "3.0"
PCIEVersion4 = "4.0"
PCIEVersion5 = "5.0"
PCIEVersion6 = "6.0"
PCIEVersion7 = "7.0"
PCIEVersionUnknown = "unknown"
)
type PCIEVersionThroughput struct {
Version string
Throughput float64
}
func NewPCIEVersionThroughput(version string) PCIEVersionThroughput {
// FROM: https://en.wikipedia.org/wiki/PCI_Express
var (
v1 = 0.25
v2 = 0.5
v3 = 0.985
v4 = 1.969
v5 = 3.938
v6 = 7.563
v7 = 15.125
)
table := map[string]float64{
PCIEVersion1: v1,
PCIEVersion2: v2,
PCIEVersion3: v3,
PCIEVersion4: v4,
PCIEVersion5: v5,
PCIEVersion6: v6,
PCIEVersion7: v7,
}
tp, ok := table[version]
if ok {
return PCIEVersionThroughput{
Version: version,
Throughput: tp,
}
}
return PCIEVersionThroughput{
Version: PCIEVersionUnknown,
Throughput: -1,
}
}
func (info *IsolatedDevicePCIEInfo) fillData() error {
vTp := info.GetThroughputPerLane()
info.Version = vTp.Version
info.Throughput = fmt.Sprintf("%.2f GB/s", vTp.Throughput*float64(info.LaneWidth))
return nil
}
func (info IsolatedDevicePCIEInfo) GetThroughputPerLane() PCIEVersionThroughput {
table := map[string]PCIEVersionThroughput{
// version 1.0: 2003
"2.5": NewPCIEVersionThroughput(PCIEVersion1),
// version 2.0: 2007
"5": NewPCIEVersionThroughput(PCIEVersion2),
"5.0": NewPCIEVersionThroughput(PCIEVersion2),
// version 3.0: 2010
"8": NewPCIEVersionThroughput(PCIEVersion3),
"8.0": NewPCIEVersionThroughput(PCIEVersion3),
// version 4.0: 2017
"16": NewPCIEVersionThroughput(PCIEVersion4),
"16.0": NewPCIEVersionThroughput(PCIEVersion4),
// version 5.0: 2019
"32": NewPCIEVersionThroughput(PCIEVersion5),
"32.0": NewPCIEVersionThroughput(PCIEVersion5),
// version 6.0: 2022
"64": NewPCIEVersionThroughput(PCIEVersion6),
"64.0": NewPCIEVersionThroughput(PCIEVersion6),
// version 7.0: 2025(planned)
"128": NewPCIEVersionThroughput(PCIEVersion7),
"128.0": NewPCIEVersionThroughput(PCIEVersion7),
}
for key, val := range table {
if fmt.Sprintf("%sGT/s", key) == info.TransferRatePerLane {
return val
}
}
return NewPCIEVersionThroughput(PCIEVersionUnknown)
}

View File

@@ -47,3 +47,9 @@ var VENDOR_ID_MAP = map[string]string{
"NVIDIA": NVIDIA_VENDOR_ID,
"AMD": AMD_VENDOR_ID,
}
const (
ISOLATED_DEVICE_MODEL_METADATA_BANDWIDTH = "bandwidth"
ISOLATED_DEVICE_MODEL_METADATA_MEMORY_MB = "memory_mb"
ISOLATED_DEVICE_MODEL_METADATA_TFLOPS = "tflops"
)

View File

@@ -0,0 +1,106 @@
// 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 (
"fmt"
"testing"
)
func TestSIsolatedDevicePCIInfo_GetThroughputPerLane(t *testing.T) {
type fields struct {
TransferRatePerLane string
LaneWidth int
}
tests := []struct {
fields fields
want float64
}{
{
fields{
"2.5GT/s",
1,
},
0.25,
},
{
fields{
"2.6GT/s",
1,
},
-1,
},
{
fields{
"5.0GT/s",
2,
},
0.5,
},
{
fields{
"5GT/s",
2,
},
0.5,
},
{
fields{
"8GT/s",
1,
},
0.985,
},
{
fields{
"16GT/s",
1,
},
1.969,
},
{
fields{
"32GT/s",
1,
},
3.938,
},
{
fields{
"64GT/s",
1,
},
7.563,
},
{
fields{
"128GT/s",
1,
},
15.125,
},
}
for _, tt := range tests {
t.Run(fmt.Sprintf("Speed %s, Width x%d", tt.fields.TransferRatePerLane, tt.fields.LaneWidth), func(t *testing.T) {
info := IsolatedDevicePCIEInfo{
TransferRatePerLane: tt.fields.TransferRatePerLane,
LaneWidth: tt.fields.LaneWidth,
}
if got := info.GetThroughputPerLane(); got.Throughput != tt.want {
t.Errorf("SIsolatedDevicePCIInfo.GetThroughputPerLane() = %v, want %v", got, tt.want)
}
})
}
}

View File

@@ -42,6 +42,8 @@ type KafkaDetails struct {
VpcResourceInfoBase
NetworkResourceInfoBase
ZoneResourceInfoBase
SKafka
}
// 资源列表请求参数
@@ -50,7 +52,5 @@ type KafkaListInput struct {
apis.ExternalizedResourceBaseListInput
apis.DeletePreventableResourceBaseListInput
RegionalFilterListInput
ManagedResourceListInput
VpcFilterListInput
}

View File

@@ -69,8 +69,6 @@ type KubeClusterDetails struct {
apis.EnabledStatusInfrasResourceBaseDetails
SKubeCluster
ManagedResourceInfo
CloudregionResourceInfo
VpcResourceInfo
}
@@ -90,7 +88,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

@@ -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

@@ -59,6 +59,7 @@ type MongoDBDetails struct {
ManagedResourceInfo
VpcResourceInfoBase
SMongoDB
// IP子网名称
// example: test-network

View File

@@ -21,6 +21,13 @@ import (
"yunion.io/x/onecloud/pkg/cloudcommon/types"
)
type TAddressType string
const (
AddressTypeIPv4 = TAddressType("ipv4")
AddressTypeIPv6 = TAddressType("ipv6")
)
const (
NETWORK_TYPE_VPC = compute.NETWORK_TYPE_VPC
NETWORK_TYPE_CLASSIC = compute.NETWORK_TYPE_CLASSIC
@@ -182,19 +189,19 @@ type NetworkCreateInput struct {
// example: 10.168.222.1/24
GuestIpPrefix string `json:"guest_ip_prefix"`
// description: ip range of guest ip start, if set guest_ip_prefix, this parameter will be useless
// description: ip range of guest ip start, if set guest_ip_prefix, this parameter will be ignored
// example: 10.168.222.1
GuestIpStart string `json:"guest_ip_start"`
// description: ip range of guest ip end, if set guest_ip_prefix, this parameter will be useless
// description: ip range of guest ip end, if set guest_ip_prefix, this parameter will be ignored
// example: 10.168.222.100
GuestIpEnd string `json:"guest_ip_end"`
// description: ip range of guest ip mask, if set guest_ip_prefix, this parameter will be useless
// description: ip range of guest ip mask, if set guest_ip_prefix, this parameter will be ignored
// example: 24
// maximum: 30
// minimum: 12
GuestIpMask int64 `json:"guest_ip_mask"`
GuestIpMask int8 `json:"guest_ip_mask"`
IfnameHint string `json:"ifname_hint"`
@@ -202,6 +209,25 @@ type NetworkCreateInput struct {
// example: 192.168.222.1
GuestGateway string `json:"guest_gateway"`
// description: ipv6 range of guest, if not set, you shoud set guest_ip6_start,guest_ip6_end and guest_ip6_mask params
// example: 3ffe:3200:2001:2300::/64
GuestIp6Prefix string `json:"guest_ip6_prefix"`
// description: ipv6 range of guest ip start, if set guest_ip6_prefix, this parameter will be ignored
// example: 3ffe:3200:2001:2300::1
GuestIp6Start string `json:"guest_ip6_start"`
// description: ipv6 range of guest ip end, if set guest_ip6_prefix, this parameter will be ignored
// example: 3ffe:3200:2001:2300:ffff:ffff:ffff:ffff
GuestIp6End string `json:"guest_ip6_end"`
// description: ipv6 range of guest ip mask, if set guest_ip6_prefix, this parameter will be ignored
// example: 64
// maximum: 126
// minimum: 48
GuestIp6Mask uint8 `json:"guest_ip6_mask"`
// description: guest gateway of IPv6
// example: 3ffe:3200:2001:2300::1
GuestGateway6 string `json:"guest_gateway6"`
// description: guest dns
// example: 114.114.114.114,8.8.8.8
GuestDns string `json:"guest_dns"`
@@ -250,15 +276,23 @@ type NetworkCreateInput struct {
type SNetworkNics struct {
// 虚拟机网卡数量
Vnics int `json:"vnics"`
// IPv4地址数量
Vnics4 int `json:"vnics4"`
// IPv6地址数量
Vnics6 int `json:"vnics6"`
// 裸金属网卡数量
BmVnics int `json:"bm_vnics"`
// 负载均衡网卡数量
LbVnics int `json:"lb_vnics"`
// 浮动Ip网卡数量
EipVnics int `json:"eip_vnics"`
EipVnics int `json:"eip_vnics"`
// VIP数量
GroupVnics int `json:"group_vnics"`
// 预留IP数量
ReserveVnics int `json:"reserve_vnics"`
// 预留IPv4数量
ReserveVnics4 int `json:"reserve_vnics4"`
// 预留IPv6数量
ReserveVnics6 int `json:"reserve_vnics6"`
// RDS网卡数量
RdsVnics int `json:"rds_vnics"`
@@ -273,21 +307,29 @@ type SNetworkNics struct {
PortsUsed int `json:"ports_used"`
Total int `json:"total"`
// 已使用IPv4端口数量
Ports6Used int `json:"ports6_used"`
Total6 int `json:"total6"`
}
func (self *SNetworkNics) SumTotal() {
self.Total = self.Vnics +
self.Total = self.Vnics4 +
self.BmVnics +
self.LbVnics +
self.LbVnics +
self.EipVnics +
self.GroupVnics +
self.ReserveVnics +
self.ReserveVnics4 +
self.RdsVnics +
self.NetworkinterfaceVnics +
self.NatVnics -
self.BmReusedVnics
self.Total6 = self.Vnics6 +
self.ReserveVnics6
self.PortsUsed = self.Total
self.Ports6Used = self.Total6
}
type NetworkDetails struct {
@@ -302,11 +344,15 @@ type NetworkDetails struct {
// 端口数量
Ports int `json:"ports"`
Dns string `json:"dns"`
// 路由信息
Routes []types.SRoute `json:"routes"`
Schedtags []SchedtagShortDescDetails `json:"schedtags"`
IsClassic bool `json:"is_classic"`
AdditionalWires []SSimpleWire `json:"additional_wires"`
}
type NetworkIpMacDetails struct {
@@ -394,20 +440,29 @@ type NetworkUpdateInput struct {
// 起始IP地址
GuestIpStart string `json:"guest_ip_start"`
// 接收IP地址
// 结束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"`
// 起始IP6地址
GuestIp6Start *string `json:"guest_ip6_start"`
// 结束IP6地址
GuestIp6End *string `json:"guest_ip6_end"`
// IP6子网掩码长度
GuestIp6Mask *uint8 `json:"guest_ip6_mask"`
// IP6网关地址
GuestGateway6 *string `json:"guest_gateway6"`
GuestDomain *string `json:"guest_domain"`
VlanId *int `json:"vlan_id"`
@@ -426,6 +481,20 @@ type GetNetworkAddressesInput struct {
type GetNetworkAddressesOutput struct {
// IP子网地址记录
Addresses []SNetworkUsedAddress `json:"addresses"`
// IPv6子网地址记录
Addresses6 []SNetworkUsedAddress `json:"addresses6"`
}
type GetNetworkAvailableAddressesInput struct {
}
type GetNetworkAvailableAddressesOutput struct {
// IP子网地址记录
Addresses []string `json:"addresses"`
// IPv6子网地址记录
Addresses6 []string `json:"addresses6"`
}
type NetworkSetBgpTypeInput struct {
@@ -450,3 +519,9 @@ type NetworkSwitchWireInput struct {
// example: bcast0
WireId string `json:"wire_id"`
}
type NetworSyncAdditionalWiresInput struct {
apis.Meta
WireIds []string `json:"wire_ids"`
}

View File

@@ -20,13 +20,11 @@ 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
// in mbps, maximal is 100Tbps
MAX_BANDWIDTH = 100000000
NETWORK_TYPE_GUEST = compute.NETWORK_TYPE_GUEST
NETWORK_TYPE_BAREMETAL = "baremetal"
@@ -89,13 +87,14 @@ type IPAllocationDirection string
const (
IPAllocationStepdown IPAllocationDirection = "stepdown"
IPAllocationStepup IPAllocationDirection = "stepup"
IPAllocationRadnom IPAllocationDirection = "random"
IPAllocationRandom IPAllocationDirection = "random"
IPAllocationNone IPAllocationDirection = "none"
IPAllocationDefault = ""
)
type SNetworkUsedAddress struct {
IpAddr string
Ip6Addr string
MacAddr string
Owner string
OwnerId string

View File

@@ -55,8 +55,30 @@ type ProjectMappingRuleInfo struct {
Domain string `json:"domain"`
}
func (rule ProjectMappingRuleInfo) IsWide() bool {
for _, tag := range rule.Tags {
if len(tag.Value) == 0 {
return true
}
}
return false
}
type MappingRules []ProjectMappingRuleInfo
func (rules MappingRules) Rules() MappingRules {
normal := []ProjectMappingRuleInfo{}
wide := []ProjectMappingRuleInfo{}
for _, rule := range rules {
if rule.IsWide() {
wide = append(wide, rule)
} else {
normal = append(normal, rule)
}
}
return append(normal, wide...)
}
func (rule *ProjectMappingRuleInfo) Validate() error {
if len(rule.Tags) == 0 {
return httperrors.NewInputParameterError("missing tags")
@@ -79,7 +101,7 @@ func (rule *ProjectMappingRuleInfo) Validate() error {
if emptyValueTags != 1 && rule.AutoCreateProject {
return httperrors.NewInputParameterError("not support auto_create_project")
}
if !rule.AutoCreateProject && len(rule.ProjectId) == 0 {
if !rule.AutoCreateProject && len(rule.ProjectId) == 0 && len(rule.Project) == 0 {
return httperrors.NewInputParameterError("missing project_id")
}
return nil
@@ -103,6 +125,9 @@ func (self *ProjectMappingRuleInfo) IsMatchTags(_extTags map[string]string) (str
newProj = extTag
}
}
if !self.AutoCreateProject && len(self.ProjectId) == 0 && len(self.Project) > 0 {
newProj = self.Project
}
return self.DomainId, self.ProjectId, newProj, true
case MAPPING_CONDITION_OR:
for _, tag := range self.Tags {
@@ -110,6 +135,8 @@ func (self *ProjectMappingRuleInfo) IsMatchTags(_extTags map[string]string) (str
if ok && (len(tag.Value) == 0 || tag.Value == extTag) {
if self.AutoCreateProject && len(tag.Value) == 0 && len(extTag) > 0 {
return "", "", extTag, true
} else if !self.AutoCreateProject && len(self.ProjectId) == 0 && len(self.Project) > 0 {
return self.DomainId, self.ProjectId, self.Project, true
} else {
return self.DomainId, self.ProjectId, "", true
}
@@ -143,6 +170,8 @@ type SProjectMappingAccount struct {
}
type ProjectMappingDetails struct {
SProjectMapping
apis.EnabledStatusInfrasResourceBaseDetails
Rules []ProjectMappingRuleInfoDetails
@@ -157,6 +186,7 @@ type ProjectMappingDetails struct {
type ProjectMappingCreateInput struct {
apis.EnabledStatusInfrasResourceBaseCreateInput
// 根据标签key匹配的规则会默认排到列表最后
Rules MappingRules
}
@@ -171,6 +201,7 @@ type ProjectMappingResourceInfo struct {
type ProjectMappingUpdateInput struct {
apis.EnabledStatusInfrasResourceBaseUpdateInput
// 根据标签key匹配的规则会默认排到列表最后
Rules MappingRules
}

View File

@@ -51,6 +51,7 @@ const (
OPERATOR_LT = "lt" // 小于
TIMER_TYPE_ONCE = "once"
TIMER_TYPE_HOUR = "hour"
TIMER_TYPE_DAY = "day"
TIMER_TYPE_WEEK = "week"
TIMER_TYPE_MONTH = "month"

View File

@@ -28,6 +28,7 @@ type CycleTimerCreateInput struct {
// enum: day,week,month
CycleType string `json:"cycle_type"`
CycleHour int `json:"cycle_hour"`
// description: 分(0-59)
// example: 13
Minute int `json:"minute"`

View File

@@ -83,6 +83,8 @@ type SSecgroupRuleResource struct {
Description string `json:"description"`
}
type SSecgroupRuleResourceSet []SSecgroupRuleResource
type SSecgroupRuleCreateInput struct {
apis.ResourceBaseCreateInput
SSecgroupRuleResource
@@ -90,6 +92,9 @@ type SSecgroupRuleCreateInput struct {
// swagger:ignore
Secgroup string `json:"secgroup" yunion-deprecated-by:"secgroup_id"`
// swagger: ignore
Status string `json:"status"`
// 安全组ID
// required: true
SecgroupId string `json:"secgroup_id"`
@@ -98,7 +103,37 @@ type SSecgroupRuleCreateInput struct {
type SSecgroupRuleUpdateInput struct {
apis.ResourceBaseUpdateInput
SSecgroupRuleResource
Priority *int `json:"priority"`
Ports *string `json:"ports"`
// ip或cidr地址, 若指定peer_secgroup_id此参数不生效
// example: 192.168.222.121
CIDR *string `json:"cidr"`
// 协议
// required: true
//
//
//
// | protocol | name |
// | -------- | ---- |
// | any | 所有协议|
// | tcp | TCP |
// | icmp | ICMP |
// | udp | UDP |
// enum: any, tcp, udp, icmp
Protocol *string `json:"protocol"`
// 行为
// deny: 拒绝
// allow: 允许
// enum: deny, allow
// required: true
Action *string `json:"action"`
// 规则描述信息
// requried: false
// example: test to create rule
Description string `json:"description"`
}
func (input *SSecgroupRuleResource) Check() error {
@@ -124,11 +159,12 @@ func (input *SSecgroupRuleResource) Check() error {
}
if len(input.CIDR) > 0 {
if !regutils.MatchCIDR(input.CIDR) && !regutils.MatchIPAddr(input.CIDR) {
if !regutils.MatchCIDR(input.CIDR) && !regutils.MatchIP4Addr(input.CIDR) && !regutils.MatchCIDR6(input.CIDR) && !regutils.MatchIP6Addr(input.CIDR) {
return fmt.Errorf("invalid ip address: %s", input.CIDR)
}
} else {
input.CIDR = "0.0.0.0/0"
// empty CIDR means both IPv4 and IPv6
// input.CIDR = "0.0.0.0/0"
}
return rule.ValidateRule()
@@ -137,6 +173,17 @@ func (input *SSecgroupRuleResource) Check() error {
type SSecgroupCreateInput struct {
apis.SharableVirtualResourceCreateInput
// vpc id
// defualt: default
VpcResourceInput
// swagger: ignore
CloudproviderResourceInput
// swagger: ignore
CloudregionResourceInput
// swagger: ignore
GlobalvpcId string `json:"globalvpc_id"`
// 规则列表
// required: false
Rules []SSecgroupRuleCreateInput `json:"rules"`
@@ -144,19 +191,13 @@ type SSecgroupCreateInput struct {
type SecgroupListInput struct {
apis.SharableVirtualResourceListInput
apis.ExternalizedResourceBaseListInput
ServerResourceInput
DBInstanceResourceInput
ELasticcacheResourceInput
// equals
Equals string
// 按缓存数量排序
// pattern:asc|desc
OrderByCacheCnt string `json:"order_by_cache_cnt"`
// 按缓存关联主机数排序
// pattern:asc|desc
OrderByGuestCnt string `json:"order_by_guest_cnt"`
@@ -174,25 +215,14 @@ type SecgroupListInput struct {
// example: in
Direction string `json:"direction"`
VpcId string `json:"vpc_id"`
RegionalFilterListInput
ManagedResourceListInput
WithCache bool `json:"witch_cache"`
}
type SecurityGroupCacheListInput struct {
apis.StatusStandaloneResourceListInput
apis.ExternalizedResourceBaseListInput
ManagedResourceListInput
RegionalFilterListInput
VpcFilterListInput
SecgroupFilterListInput
}
type SecurityGroupRuleListInput struct {
apis.ResourceBaseListInput
apis.ExternalizedResourceBaseListInput
SecgroupFilterListInput
Projects []string `json:"projects"`
@@ -232,6 +262,9 @@ type SecgroupDetails struct {
apis.SharableVirtualResourceDetails
SSecurityGroup
VpcResourceInfo
GlobalVpcResourceInfo
// 关联云主机数量, 不包含回收站云主机
GuestCnt int `json:"guest_cnt,allowempty"`
@@ -243,15 +276,6 @@ type SecgroupDetails struct {
// 所有关联的资源数量
TotalCnt int `json:"total_cnt,allowempty"`
// 安全组缓存数量
CacheCnt int `json:"cache_cnt,allowempty"`
// 规则信息
Rules []SecgroupRuleDetails `json:"rules"`
// 入方向规则信息
InRules []SecgroupRuleDetails `json:"in_rules"`
// 出方向规则信息
OutRules []SecgroupRuleDetails `json:"out_rules"`
}
type SecurityGroupResourceInfo struct {
@@ -292,18 +316,6 @@ type ElasticcachesecgroupDetails struct {
Secgroup string `json:"secgroup"`
}
type SecgroupMergeInput struct {
// 安全组id列表
SecgroupIds []string `json:"secgroup_ids"`
// swagger:ignore
// Deprecated
Secgroups []string `json:"secgroup" yunion-deprecated-by:"secgroup_ids"`
}
type SecurityGroupPurgeInput struct {
}
type SecurityGroupCloneInput struct {
Name string
Description string
@@ -330,6 +342,5 @@ func (self *SSecurityGroupRef) Sum() {
self.TotalCnt = self.GuestCnt + self.AdminGuestCnt + self.RdsCnt + self.RedisCnt
}
type SecurityGroupCacheInput struct {
VpcId string `json:"vpc_id"`
type SecurityGroupSyncstatusInput struct {
}

View File

@@ -17,9 +17,7 @@ package compute
import "yunion.io/x/cloudmux/pkg/apis/compute"
const (
SECGROUP_STATUS_READY = compute.SECGROUP_STATUS_READY
SECGROUP_STATUS_DELETING = "deleting" // 删除中
SECGROUP_STATUS_SYNC_RULES = "sync_rules" // 同步规则中
SECGROUP_STATUS_READY = compute.SECGROUP_STATUS_READY
SECGROUP_DEFAULT_ID = "default"
)

View File

@@ -1,31 +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"
type SecurityGroupCacheDetails struct {
apis.StatusStandaloneResourceDetails
apis.ProjectizedResourceInfo
ManagedResourceInfo
CloudregionResourceInfo
SSecurityGroupCache
// 虚拟私有网络名称
Vpc string `json:"vpc"`
ProjectId string `json:"tenant_id"`
}

View File

@@ -1,24 +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
const (
SECGROUP_CACHE_STATUS_READY = "ready"
SECGROUP_CACHE_STATUS_UNKNOWN = "unknown"
SECGROUP_CACHE_STATUS_DELETING = "deleting"
SECGROUP_CACHE_STATUS_CACHING = "caching"
SECGROUP_CACHE_STATUS_CACHE_FAILED = "cache_failed"
SECGROUP_CACHE_STATUS_DELETE_FAILED = "delete_failed"
)

View File

@@ -80,6 +80,10 @@ type ServerSkuListInput struct {
// 按套餐名称去重
Distinct bool `json:"distinct"`
// 根据cpu架构过滤
// enmu: arm, x86
CpuArch []string `json:"cpu_arch"`
// 按关联虚拟机数量排序
OrderByTotalGuestCount string `json:"order_by_total_guest_count"`
}

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