Compare commits

..

545 Commits

Author SHA1 Message Date
Zexi Li
fcabafc742 Merge pull request #5700 from swordqiu/automated-cherry-pick-of-#5698-upstream-release-3.0
Automated cherry pick of #5698: fix: service config changes not effective
2020-04-07 10:38:36 +08:00
Zexi Li
e19c91788c Merge pull request #5706 from wanyaoqi/automated-cherry-pick-of-#5704-upstream-release-3.0
Automated cherry pick of #5704: fix migrate cache cdrom
2020-04-07 10:37:24 +08:00
wanyaoqi
5b9a89d81b fix migrate cache cdrom 2020-04-06 23:19:08 +08:00
Qiu Jian
f685c1b391 fix: service config changes not effective 2020-04-06 16:11:24 +08:00
Zexi Li
089fa77540 Merge pull request #5692 from rainzm/automated-cherry-pick-of-#5691-upstream-release-3.0
Automated cherry pick of #5691: fix(esxi): Fix some question of CheckAndSetCacheImage.
2020-04-05 13:53:07 +08:00
Zexi Li
bf6b6e3f2d Merge pull request #5696 from swordqiu/automated-cherry-pick-of-#5694-upstream-release-3.0
Automated cherry pick of #5694: fix: misc bugs in usage data
2020-04-05 13:52:14 +08:00
Qiu Jian
a53e4d0220 fix: misc bugs in usage data 2020-04-05 08:00:48 +08:00
Rain
fc7240469c fix(esxi): Fix some question of CheckAndSetCacheImage.
1. If there is storagecachedimage in this host's storagecache, use is
instead of another host's one.
2. SrcStorage should be found from srcHost instead host.
2020-04-04 21:53:45 +08:00
Zexi Li
f3e89cc91a Merge pull request #5688 from ioito/automated-cherry-pick-of-#5686-upstream-release-3.0
Automated cherry pick of #5686: fix: 修复重装系统时未能更换指定image问题
2020-04-03 19:43:30 +08:00
Zexi Li
ac14001b1d Merge pull request #5673 from ioito/automated-cherry-pick-of-#5671-upstream-release-3.0
Automated cherry pick of #5671: fix: 华为云rds使用自身的存储类型
2020-04-03 19:41:46 +08:00
Qu Xuan
7451e9cadb fix: 修复重装系统时未能更换指定image问题 2020-04-03 11:35:55 +08:00
Zexi Li
b0774713a1 Merge pull request #5678 from wanyaoqi/automated-cherry-pick-of-#5676-upstream-release-3.0
Automated cherry pick of #5676: host do not set hostname
2020-04-02 19:07:28 +08:00
wanyaoqi
dde3fd44bf host do not set hostname 2020-04-02 18:13:22 +08:00
Qu Xuan
d08bb2700c fix: 华为云rds使用自身的存储类型 2020-04-02 17:30:06 +08:00
Zexi Li
517bca61c0 Merge pull request #5637 from tb365/automated-cherry-pick-of-#5631-upstream-release-3.0
Automated cherry pick of #5631: elb bugfix
2020-04-02 12:47:36 +08:00
Zexi Li
8465defe65 Merge pull request #5665 from swordqiu/automated-cherry-pick-of-#5662-upstream-release-3.0
Automated cherry pick of #5662: fix: disk/nics usage should exclude those pending_deleted
2020-04-02 12:45:49 +08:00
Zexi Li
129c2195e9 Merge pull request #5661 from wanyaoqi/automated-cherry-pick-of-#5659-upstream-release-3.0
Automated cherry pick of #5659: host session use internal endpoint
2020-04-02 12:43:21 +08:00
Qiu Jian
cebee78ee5 fix: disk/nics usage should exclude those pending_deleted 2020-04-02 01:54:45 +08:00
tangbin
c84f5730df elb bugfix 2020-04-01 20:27:36 +08:00
wanyaoqi
0219383e8d host session use internal endpoint 2020-04-01 20:01:30 +08:00
Zexi Li
f4cf25d3e5 Merge pull request #5655 from swordqiu/automated-cherry-pick-of-#5653-upstream-release-3.0
Automated cherry pick of #5653: fix: allow list cloudprovider by default
2020-04-01 18:13:53 +08:00
Zexi Li
28c5dbd1ab Merge pull request #5650 from swordqiu/automated-cherry-pick-of-#5648-upstream-release-3.0
Automated cherry pick of #5648: fix: cancel pending usage might not need to update usage
2020-04-01 18:11:29 +08:00
Qiu Jian
dcc7f2ba5c fix: allow list cloudprovider by default 2020-04-01 17:46:16 +08:00
Qiu Jian
3c4e953843 fix: cancel pending usage might not need to update usage 2020-04-01 16:53:17 +08:00
Zexi Li
bee1582654 Merge pull request #5642 from swordqiu/automated-cherry-pick-of-#5640-upstream-release-3.0
Automated cherry pick of #5640: fix: changes to request_work_count cause apigateway restart
2020-04-01 10:23:32 +08:00
Qiu Jian
f0a6c20c43 fix: changes to request_work_count cause apigateway restart 2020-04-01 10:20:05 +08:00
yunion-ci-robot
3dfce69dbc Merge pull request #5627 from swordqiu/automated-cherry-pick-of-#5623-upstream-release-3.0
Automated cherry pick of #5623: fix: worker may block by worker_chan
2020-03-31 10:29:45 +08:00
Qiu Jian
8c4f18b11f fix: worker may block by worker_chan 2020-03-31 09:52:00 +08:00
Zexi Li
69c2de1fd9 Merge pull request #5621 from swordqiu/automated-cherry-pick-of-#5616-upstream-release-3.0
Automated cherry pick of #5616: fix: increase apigateway default worker count to 32
2020-03-30 19:22:49 +08:00
Qiu Jian
c5ecdd6a42 fix: increase apigateway default worker count to 32 2020-03-30 19:08:43 +08:00
yunion-ci-robot
a79aaaedc7 Merge pull request #5611 from swordqiu/automated-cherry-pick-of-#5608-upstream-release-3.0
Automated cherry pick of #5608: fix: allow list loadbalancer cluster by default
2020-03-28 09:47:41 +08:00
Qiu Jian
b58f78a0c9 fix: allow list loadbalancer cluster by default 2020-03-28 09:05:08 +08:00
Zexi Li
8d9a76e3b3 Merge pull request #5603 from ioito/automated-cherry-pick-of-#5601-upstream-release-3.0
Automated cherry pick of #5601: fix: 修正gcp不支持预付费资源
2020-03-26 20:33:13 +08:00
Qu Xuan
173a8d6d4f fix: 修正gcp不支持预付费资源 2020-03-26 20:02:06 +08:00
Zexi Li
08bf822d17 Merge pull request #5596 from ioito/hotfix/qx-lb-provider
fix: 避免onecloud lb未返回provider及brand信息
2020-03-26 10:41:41 +08:00
Qu Xuan
2bd5b61b61 fix: 避免onecloud lb未返回provider及brand信息 2020-03-25 18:25:29 +08:00
Zexi Li
41d61a77ce Merge pull request #5583 from yousong/automated-cherry-pick-of-#5581-upstream-release-3.0
Automated cherry pick of #5581: webconsole: typo fix accessable -> accessible
2020-03-23 21:14:24 +08:00
Yousong Zhou
ce86a155f8 httperrors: fix passing "params" argument 2020-03-23 16:41:53 +08:00
Yousong Zhou
503b6f0a2a webconsole: typo fix accessable -> accessible 2020-03-23 16:41:53 +08:00
Zexi Li
a5dc903c13 Merge pull request #5580 from zexi/automated-cherry-pick-of-#5577-upstream-release-3.0
Automated cherry pick of #5577: climc: k8s storageclass support
2020-03-23 10:53:14 +08:00
Zexi Li
f8dcc93262 climc: k8s storageclass support 2020-03-23 10:53:41 +08:00
Zexi Li
8085764f20 Merge pull request #5573 from wanyaoqi/automated-cherry-pick-of-#5571-upstream-release-3.0
Automated cherry pick of #5571: guest add metadata cpu mode
2020-03-20 19:39:31 +08:00
wanyaoqi
e8b342dfb2 guest add metadata cpu mode
- live migrate if guest cpu mode is qemu, do not check host cpu mode
- disk name generation replace '_' to '-'
2020-03-20 15:14:36 +08:00
Zexi Li
1a58515573 Merge pull request #5557 from rainzm/automated-cherry-pick-of-#5555-upstream-release-3.0
Automated cherry pick of #5555: feat(notify): Compatibility and repair
2020-03-19 10:06:25 +08:00
yunion-ci-robot
439a02d9c8 Merge pull request #5492 from ioito/automated-cherry-pick-of-#5490-upstream-release-3.0
Automated cherry pick of #5490: fix: class action 统一使用keywords包裹
2020-03-19 08:48:20 +08:00
Rain
8e767cc984 feat(notify): Compatibility and repair 2020-03-18 20:59:25 +08:00
Zexi Li
e444d5e797 Merge pull request #5547 from swordqiu/automated-cherry-pick-of-#5545-upstream-release-3.0
Automated cherry pick of #5545: fix: policy fetcher not retry after initial failure
2020-03-18 10:53:08 +08:00
Qu Xuan
6022e2da2e fix: class action 统一使用keywords包裹 2020-03-17 18:44:31 +08:00
Qiu Jian
dc51ab2ee0 fix: policy fetcher not retry after initial failure 2020-03-17 18:31:00 +08:00
Zexi Li
105c0a1714 Merge pull request #5508 from swordqiu/automated-cherry-pick-of-#5506-upstream-release-3.0
Automated cherry pick of #5506: fix: recode cloudprovider usable filter
2020-03-17 11:39:52 +08:00
yunion-ci-robot
69029c088a Merge pull request #5531 from ioito/automated-cherry-pick-of-#5529-upstream-release-3.0
Automated cherry pick of #5529: fix: 避免重装系统失败后imageId依然发生改变
2020-03-17 08:21:15 +08:00
yunion-ci-robot
cd996659ac Merge pull request #5538 from ioito/automated-cherry-pick-of-#5536-upstream-release-3.0
Automated cherry pick of #5536: fix: 修复谷歌云 cloud-provider-clirc 显示错误问题
2020-03-17 08:12:15 +08:00
Qu Xuan
439e9c23f8 fix: 修复谷歌云 cloud-provider-clirc 显示错误问题 2020-03-16 20:10:04 +08:00
Zexi Li
a259eb1112 Merge pull request #5525 from ioito/automated-cherry-pick-of-#5452-upstream-release-3.0
Automated cherry pick of #5452: fix: 优化rds sku同步逻辑
2020-03-16 18:25:35 +08:00
Zexi Li
c76ca51af5 Merge pull request #5499 from zhaoxiangchun/automated-cherry-pick-of-#5496-upstream-release-3.0
Automated cherry pick of #5496: vmware 宿主机监控信息获取
2020-03-16 12:57:40 +08:00
Qu Xuan
286e001dac fix: 避免重装系统失败后imageId依然发生改变 2020-03-16 11:30:16 +08:00
Qu Xuan
1eb3abf5a1 fix: 优化rds sku同步逻辑 2020-03-16 10:34:13 +08:00
yunion-ci-robot
f51e7d0c7f Merge pull request #5521 from ioito/automated-cherry-pick-of-#5519-upstream-release-3.0
Automated cherry pick of #5519: fix: 避免未传递prority参数导致校验未通过
2020-03-16 09:08:12 +08:00
Qu Xuan
b927fa5708 fix: 避免未传递prority参数导致校验未通过 2020-03-15 13:13:16 +08:00
yunion-ci-robot
9211beb905 Merge pull request #5514 from zexi/automated-cherry-pick-of-#5511-upstream-release-3.0
Automated cherry pick of #5511: scheduler: fix disk allocated not balanced
2020-03-14 17:50:05 +08:00
Zexi Li
8d60b07d80 scheduler: fix disk allocated not balanced 2020-03-14 16:51:15 +08:00
Qiu Jian
39b5d08f14 fix: recode cloudprovider usable filter 2020-03-14 09:06:32 +08:00
Zexi Li
5b4ab09678 Merge pull request #5503 from zexi/automated-cherry-pick-of-#5501-upstream-release-3.0
Automated cherry pick of #5501: auth: check isAuthed if nil
2020-03-13 19:18:22 +08:00
Zexi Li
26802683ce auth: check isAuthed if nil 2020-03-13 19:19:44 +08:00
zhaoxiangchun
25a537c743 vmware 宿主机监控信息获取 2020-03-13 17:22:59 +08:00
yunion-ci-robot
4538ee2487 Merge pull request #5477 from rainzm/automated-cherry-pick-of-#5454-upstream-release-3.0
Automated cherry pick of #5454: fix(glance): Structured subimage info and add 'created_at' field
2020-03-13 15:34:02 +08:00
yunion-ci-robot
e2e33ef7af Merge pull request #5487 from wanyaoqi/automated-cherry-pick-of-#5484-upstream-release-3.0
Automated cherry pick of #5484: download handler set no timeout
2020-03-13 14:33:02 +08:00
wanyaoqi
5e3270b7f4 download handler set no timeout 2020-03-13 11:42:14 +08:00
Zexi Li
f282022f9e Merge pull request #5482 from rainzm/automated-cherry-pick-of-#5480-upstream-release-3.0
Automated cherry pick of #5480: fix(esxi): VlanID '1' is default value
2020-03-13 11:11:23 +08:00
Rain
d02dae88f2 fix(esxi): VlanID '1' is default value 2020-03-12 20:59:03 +08:00
Rain
650745ef1f fix(glance): Structured subimage info and add 'created_at' field 2020-03-12 19:24:18 +08:00
Zexi Li
40cdc198c8 Merge pull request #5461 from bistuzx/automated-cherry-pick-of-#5459-upstream-release-3.0
Automated cherry pick of #5459: add bucket connection test
2020-03-12 16:20:26 +08:00
张旭
a4ef41c5bb change climc bucket options import 2020-03-12 12:27:31 +08:00
张旭
698fc0e1cb add bucket connection test 2020-03-12 12:27:31 +08:00
Zexi Li
2c35de74c8 Merge pull request #5465 from rainzm/feat/vendor_3.0
feat: Update Vendor for release/3.0
2020-03-12 11:48:34 +08:00
Rain
f70d781f0d feat: Update Vendor for release/3.0 2020-03-12 11:46:31 +08:00
yunion-ci-robot
a8ea730823 Merge pull request #5445 from rainzm/automated-cherry-pick-of-#5444-upstream-release-3.0
Automated cherry pick of #5444: fix(esxi): UnitNumber 7 is unavailable for scsi controller
2020-03-12 02:54:01 +08:00
yunion-ci-robot
f4f34c1c3d Merge pull request #5440 from rainzm/automated-cherry-pick-of-#5439-upstream-release-3.0
Automated cherry pick of #5439: fix(esxi): Fix bugs when using network with vlanID
2020-03-12 02:48:01 +08:00
Zexi Li
05ea4797d8 Merge pull request #5449 from zexi/automated-cherry-pick-of-#5447-upstream-release-3.0
Automated cherry pick of #5447: region: host update storage set enabled
2020-03-11 15:58:28 +08:00
Zexi Li
494c540ac1 region: host update storage set enabled 2020-03-11 15:59:05 +08:00
Rain
e0838efff8 fix(esxi): UnitNumber 7 is unavailable for scsi controller
By default, the virtual SCSI controller is assigned to virtual device node (z:7),
so that device node is unavailable for hard disks or other devices.
https://docs.vmware.com/en/VMware-vSphere/6.7/com.vmware.vsphere.vm_admin.doc/GUID-5872D173-A076-42FE-8D0B-9DB0EB0E7362.html
2020-03-11 15:17:33 +08:00
Rain
f3f449f27a fix(esxi): Fix bugs when using network with vlanID 2020-03-11 11:02:31 +08:00
Zexi Li
ce74310ca1 Merge pull request #5421 from swordqiu/automated-cherry-pick-of-#5419-upstream-release-3.0
Automated cherry pick of #5419: fix: fail to find esxi admin vnic, use vnic with default IPv4 route
2020-03-10 14:46:02 +08:00
yunion-ci-robot
4ee1079d95 Merge pull request #5431 from ioito/automated-cherry-pick-of-#5429-upstream-release-3.0
Automated cherry pick of #5429: fix: typo for sku sync
2020-03-10 11:14:57 +08:00
yunion-ci-robot
3dbaa6daba Merge pull request #5427 from rainzm/automated-cherry-pick-of-#5424-upstream-release-3.0
Automated cherry pick of #5424: fix(esxi): Add two account with same account name
2020-03-10 11:03:59 +08:00
Qu Xuan
64b9bac4a9 fix: typo for sku sync 2020-03-09 19:59:04 +08:00
Rain
75410934fe fix(esxi): Add two account with same account name 2020-03-09 17:58:56 +08:00
Qiu Jian
fae4cf63e2 fix: fail to find esxi admin vnic, use vnic with default IPv4 route 2020-03-09 15:58:13 +08:00
Zexi Li
0cd71ca469 Merge pull request #5416 from zexi/automated-cherry-pick-of-#5414-upstream-release-3.0
Automated cherry pick of #5414: opslog: notes use text column
2020-03-09 12:36:28 +08:00
Zexi Li
2326f8e397 Merge pull request #5400 from swordqiu/automated-cherry-pick-of-#5398-upstream-release-3.0
Automated cherry pick of #5398: fix: not check domain quota if non_default_domain_project is off
2020-03-09 12:31:54 +08:00
Zexi Li
5e39414807 opslog: notes use text column 2020-03-09 12:31:28 +08:00
Zexi Li
2c3340db6d Merge pull request #5405 from swordqiu/automated-cherry-pick-of-#5403-upstream-release-3.0
Automated cherry pick of #5403: fix: cloudprovider performEnable should also enable its cloudaccount
2020-03-09 12:30:34 +08:00
Zexi Li
54aff23fd2 Merge pull request #5410 from swordqiu/automated-cherry-pick-of-#5408-upstream-release-3.0
Automated cherry pick of #5408: feature: climc docker image add vim
2020-03-09 09:28:01 +08:00
Qiu Jian
c500036b1a feature: climc docker image add vim 2020-03-08 22:47:29 +08:00
Qiu Jian
51fdaed08c fix: cloudprovider performEnable should also enable its cloudaccount 2020-03-08 16:14:10 +08:00
Qiu Jian
1e58907468 fix: not check domain quota if non_default_domain_project is off 2020-03-07 18:17:15 +08:00
Zexi Li
4e7202af40 Merge pull request #5394 from swordqiu/automated-cherry-pick-of-#5392-upstream-release-3.0
Automated cherry pick of #5392: fix: scoped resource should override FetchOwnerId
2020-03-07 15:51:45 +08:00
Qiu Jian
444c2bc56e fix: scoped resource should override FetchOwnerId 2020-03-07 15:42:13 +08:00
Zexi Li
ae5f1e308b Merge pull request #5390 from swordqiu/automated-cherry-pick-of-#5388-upstream-release-3.0
Automated cherry pick of #5388: fix: keystone prefers internal endpoint type
2020-03-06 22:22:55 +08:00
Qiu Jian
12ce1a0056 fix: keystone prefers internal endpoint type 2020-03-06 21:46:30 +08:00
yunion-ci-robot
90008ff727 Merge pull request #5384 from rainzm/automated-cherry-pick-of-#5378-upstream-release-3.0
Automated cherry pick of #5378: fix: Add 'scope=system' and 'system' for Caches when querying from Keystone.
2020-03-06 19:17:50 +08:00
Zexi Li
565696ca54 Merge pull request #5374 from swordqiu/automated-cherry-pick-of-#5372-upstream-release-3.0
Automated cherry pick of #5372: fix: no scope shcedtag should be visible to all
2020-03-06 18:32:33 +08:00
yunion-ci-robot
ae0de12280 Merge pull request #5381 from tb365/automated-cherry-pick-of-#5379-upstream-release-3.0
Automated cherry pick of #5379: huawei reset password bugfix
2020-03-06 18:12:51 +08:00
Rain
bf4ca9c7f4 fix: Add 'scope=system' and 'system' for Caches when querying from Keystone.
1. Query 'scope=system' and 'system=true' is neccessary when fetching all users
   or groups from Keystone.
   Without these, users and groups in other domains (non-caller domains),
   as well as system-level users, cannot be detected.
2. Query 'scope=system' is neccessary when fetching all project from Keystone.
2020-03-06 17:16:23 +08:00
TangBin
f50ffc31a7 ctyun region name fix 2020-03-06 16:51:58 +08:00
TangBin
9a7cad2507 huawei reset password bugfix 2020-03-06 16:51:57 +08:00
Qiu Jian
4efe569446 fix: no scope shcedtag should be visible to all 2020-03-06 15:23:51 +08:00
Zexi Li
ed512d2881 Merge pull request #5368 from rainzm/automated-cherry-pick-of-#5366-upstream-release-3.0
Automated cherry pick of #5366: fix/notify: Fix the resend mechanism
2020-03-06 12:46:08 +08:00
Rain
61d9bd3da9 fix/notify: Fix the resend mechanism 2020-03-06 11:12:59 +08:00
yunion-ci-robot
8e9cd48302 Merge pull request #5356 from rainzm/automated-cherry-pick-of-#5353-upstream-release-3.0
Automated cherry pick of #5353: feature(notify): Add query and return value for contact UPDATE interface
2020-03-05 19:03:51 +08:00
Rain
897410d87f fix the conflict 2020-03-05 17:44:38 +08:00
Rain
cf1ae4cac3 feature(notify): Add query and return value for contact UPDATE interface
1. Add same return value with contact GET interface when updating
2. Add pull params for query to pull subcontact by mobile number.
   For example, pull user_id from dingtalk throught user's mobile
   number.
3. Add corresponding feature based on above for climc.
4. UserCache will try FetchByName if there is no id matched user when
   fetching users from KeyStone.
2020-03-05 17:43:28 +08:00
Zexi Li
f8358cdde2 Merge pull request #5348 from swordqiu/hotfix/qj-update-autogen-struct-json-fieldname-for-3.0
fix: update autogen struct json fieldname for release/3.0
2020-03-05 14:08:02 +08:00
Qiu Jian
2e51e8d7e8 update autogen struct with comment lines 2020-03-04 21:24:48 +08:00
yunion-ci-robot
7b7d197939 Merge pull request #5345 from ioito/automated-cherry-pick-of-#5343-upstream-release-3.0
Automated cherry pick of #5343: fix: 支持aws rds sync
2020-03-04 20:50:12 +08:00
Qiu Jian
d019dded59 fix: update autogen struct json fieldname for release/3.0 2020-03-04 20:29:55 +08:00
Qu Xuan
6ee9a428d4 fix: 支持aws rds sync 2020-03-04 20:10:43 +08:00
Zexi Li
fe096bc117 Merge pull request #5337 from swordqiu/automated-cherry-pick-of-#5336-upstream-release-3.0
Automated cherry pick of #5336: fix: keystone user password history check should skip system account
2020-03-04 19:16:22 +08:00
Qiu Jian
bf9bcb191d fix: keystone user password history check should skip system account 2020-03-04 18:37:57 +08:00
Zexi Li
cc0377dafb Merge pull request #5326 from swordqiu/automated-cherry-pick-of-#5324-upstream-release-3.0
Automated cherry pick of #5324: fix: clean up pending usage no matter whether object upload is success
2020-03-03 13:14:23 +08:00
yunion-ci-robot
dce85ee9ee Merge pull request #5317 from ioito/automated-cherry-pick-of-#5315-upstream-release-3.0
Automated cherry pick of #5315: fix: 避免旧套餐下架zone信息未知,导致同步rds异常
2020-03-03 02:22:43 +08:00
Qiu Jian
bc3ce3d2a1 fix: clean up pending usage no matter whether object upload is success 2020-03-03 02:13:15 +08:00
Qu Xuan
27bb5eaa2b fix: 避免旧套餐下架zone信息未知,导致同步rds异常 2020-03-02 17:09:37 +08:00
Zexi Li
c630607066 Merge pull request #5314 from wanyaoqi/automated-cherry-pick-of-#5312-upstream-release-3.0
Automated cherry pick of #5312: fix get remote address because of request is proxyed by k8s
2020-02-28 23:57:25 +08:00
yunion-ci-robot
e2762d75ca Merge pull request #5272 from zhaoxiangchun/automated-cherry-pick-of-#5268-upstream-release-3.0
Automated cherry pick of #5268: 谷歌云multicloud监控
2020-02-28 23:17:29 +08:00
wanyaoqi
03f4cf19ed fix get remote address because of request is proxyed by k8s 2020-02-28 22:27:47 +08:00
yunion-ci-robot
c4bbd519bc Merge pull request #5309 from ioito/automated-cherry-pick-of-#5307-upstream-release-3.0
Automated cherry pick of #5307: 修复aliyun没有权限获取余额问题
2020-02-28 22:02:28 +08:00
yunion-ci-robot
79b03d99c6 Merge pull request #5288 from wanyaoqi/automated-cherry-pick-of-#5286-upstream-release-3.0
Automated cherry pick of #5286: host register use default vpc
2020-02-28 21:54:21 +08:00
yunion-ci-robot
32da0918ba Merge pull request #5300 from tb365/bugfix/tb-bugfix-022803
vpc list add param vpc_usable
2020-02-28 21:23:19 +08:00
yunion-ci-robot
e6128db1a4 Merge pull request #5283 from wanyaoqi/automated-cherry-pick-of-#5255-upstream-release-3.0
Automated cherry pick of #5255: fix nic get pci address
2020-02-28 21:08:21 +08:00
yunion-ci-robot
fe5a701849 Merge pull request #5279 from ioito/automated-cherry-pick-of-#5277-upstream-release-3.0
Automated cherry pick of #5277: fix: 新加gcp region 翻译
2020-02-28 20:50:20 +08:00
Qu Xuan
9d2bf8556c 修复aliyun没有权限获取余额问题 2020-02-28 19:55:53 +08:00
wanyaoqi
90ee7c2934 host register use default vpc 2020-02-28 18:37:31 +08:00
TangBin
bff54a22fd vpc list add param vpc_usable 2020-02-28 14:47:56 +08:00
yunion-ci-robot
a166467f75 Merge pull request #5292 from ioito/automated-cherry-pick-of-#5290-upstream-release-3.0
Automated cherry pick of #5290: 添加azure region city信息
2020-02-28 13:16:20 +08:00
Qu Xuan
87377deee7 添加azure region city信息 2020-02-28 11:37:23 +08:00
wanyaoqi
1ade0a645f fix nic get pci address 2020-02-27 22:56:04 +08:00
zhaoxiangchun
ad79f8a557 谷歌云multicloud监控
monitor.go文件中GetMonitorData函数:
 1)首先组装参数信息
 2)通过external_id获取相关id信息,根据restAPI文档中的resource格式拼装完成monitoring相关的resource信息
 3)然后通过monitorList函数获取相关的监控信息

更新go.mod google.golang.org所依赖的google.golang.org/api版本
2020-02-27 19:34:34 +08:00
Qu Xuan
4b1e038ac6 fix: 新加gcp region 翻译 2020-02-27 18:55:07 +08:00
yunion-ci-robot
cf8426fad0 Merge pull request #5264 from rainzm/automated-cherry-pick-of-#5263-upstream-release-3.0
Automated cherry pick of #5263: fix(esxiagent): SSHKey was not unmarshalled correctly
2020-02-27 07:13:13 +08:00
yunion-ci-robot
3cf9b22ae4 Merge pull request #5240 from wanyaoqi/automated-cherry-pick-of-#5238-upstream-release-3.0
Automated cherry pick of #5238: fix host init set reserve memory
2020-02-26 23:03:15 +08:00
yunion-ci-robot
bb8b474b59 Merge pull request #5253 from swordqiu/automated-cherry-pick-of-#5252-upstream-release-3.0
Automated cherry pick of #5252: fix: use globalEndpointType as default endpoint type
2020-02-26 21:03:17 +08:00
wanyaoqi
1a2826d37b makesure /etc/ceph created before connect 2020-02-26 20:45:47 +08:00
Rain
02758cf5e2 fix(esxiagent): SSHKey was not unmarshalled correctly 2020-02-26 20:11:33 +08:00
yunion-ci-robot
5ebf23518d Merge pull request #5233 from ioito/automated-cherry-pick-of-#5231-upstream-release-3.0
Automated cherry pick of #5231: fix: 添加磁盘回滚snapshot日志
2020-02-26 16:00:15 +08:00
yunion-ci-robot
90a6b15c79 Merge pull request #5244 from ioito/automated-cherry-pick-of-#5242-upstream-release-3.0
Automated cherry pick of #5242: fix: 避免根磁盘小于镜像大小导致创建失败
2020-02-26 10:18:13 +08:00
yunion-ci-robot
ac6a4169c3 Merge pull request #5249 from ioito/automated-cherry-pick-of-#5247-upstream-release-3.0
Automated cherry pick of #5247: fix: 返回azure api 错误信息
2020-02-25 21:06:22 +08:00
Qiu Jian
9082f913c2 fix: use globalEndpointType as default endpoint type 2020-02-25 20:46:50 +08:00
Qu Xuan
c05188ef50 fix: 返回azure api 错误信息 2020-02-25 19:31:30 +08:00
Qu Xuan
b69f4b50fb fix: 避免根磁盘小于镜像大小导致创建失败 2020-02-25 15:40:30 +08:00
wanyaoqi
b3b80fbeef fix host register get network filter: add server_type baremetal 2020-02-25 11:33:01 +08:00
wanyaoqi
9bd0d49baa fix guest network get desc 2020-02-25 11:33:01 +08:00
wanyaoqi
23bfba422d fix host init set reserve memory 2020-02-25 11:28:32 +08:00
Qu Xuan
6fa93c25ad fix: 添加磁盘回滚snapshot日志 2020-02-24 16:07:52 +08:00
yunion-ci-robot
12f3df951e Merge pull request #5228 from rainzm/automated-cherry-pick-of-#5186-upstream-release-3.0
Automated cherry pick of #5186: feature(notify): Validate config
2020-02-24 15:27:08 +08:00
Rain
eabed8d47d feature(notify): Validate config 2020-02-24 14:11:56 +08:00
Zexi Li
09e63478c6 Merge pull request #5211 from swordqiu/automated-cherry-pick-of-#5208-upstream-release-3.0
Automated cherry pick of #5208: fix: reset paging limit to 2048 from 20
2020-02-21 16:46:09 +08:00
Zexi Li
3590253480 Merge pull request #5219 from rainzm/automated-cherry-pick-of-#5217-upstream-release-3.0
Automated cherry pick of #5217: fix: Storage filter not work for Esxi
2020-02-21 16:44:42 +08:00
yunion-ci-robot
cd02610f23 Merge pull request #5206 from tb365/automated-cherry-pick-of-#5199-upstream-release-3.0
Automated cherry pick of #5199: cloud region city list add default limit 2048
2020-02-21 15:56:39 +08:00
Rain
d2d551e6cd fix: Storage filter not work for Esxi
1. SESXiGuestDriver.DoScheduleStorageFilter should return true.
2. ESXi's SHost.GetStorageSizeMB should return the capacity of all the
storage belonging to it.
2020-02-21 15:13:49 +08:00
yunion-ci-robot
0d5dbf62b8 Merge pull request #5215 from ioito/automated-cherry-pick-of-#5213-upstream-release-3.0
Automated cherry pick of #5213: fix: 添加gcp region中文翻译
2020-02-20 21:16:33 +08:00
yunion-ci-robot
de59d8895a Merge pull request #5201 from ioito/automated-cherry-pick-of-#5198-upstream-release-3.0
Automated cherry pick of #5198: fix: 修复azure坐标问题,添加新的azure region城市信息
2020-02-20 21:01:28 +08:00
yunion-ci-robot
f9573c4cbf Merge pull request #5193 from ioito/automated-cherry-pick-of-#5191-upstream-release-3.0
Automated cherry pick of #5191: fix: add aliyun new region info
2020-02-20 18:19:28 +08:00
Qu Xuan
b3d1bfea0c fix: 添加gcp region中文翻译 2020-02-20 17:39:05 +08:00
TangBin
7667ed425e huawei cloud create bugfix 2020-02-20 15:40:17 +08:00
TangBin
20ce2ca01f huawei cloud create bugfix 2020-02-20 15:39:43 +08:00
TangBin
32cdc3e2cd cloud region city list add default limit 2048 2020-02-20 15:39:43 +08:00
yunion-ci-robot
9fb1f6c224 Merge pull request #5189 from ioito/automated-cherry-pick-of-#5187-upstream-release-3.0
Automated cherry pick of #5187: fix: 填充gcp disk_format字段
2020-02-20 15:30:31 +08:00
Qiu Jian
4d44569f40 fix: reset paging limit to 2048 from 20 2020-02-20 15:21:03 +08:00
Qu Xuan
5a14e40ba4 fix: 修复azure坐标问题,添加新的azure region城市信息 2020-02-20 14:55:51 +08:00
Qu Xuan
1081410846 fix: add aliyun new region info 2020-02-20 11:07:36 +08:00
Qu Xuan
942ff1d661 fix: 填充gcp disk_format字段 2020-02-20 10:46:11 +08:00
yunion-ci-robot
ef6e90f9cb Merge pull request #5184 from tb365/automated-cherry-pick-of-#5181-upstream-release-3.0
Automated cherry pick of #5181: aws listener sync fix
2020-02-19 19:18:28 +08:00
tangbin
8bdf8807de huawei http listener sync fix 2020-02-19 18:47:56 +08:00
tangbin
81eab50f3b aws rebuild root fix 2020-02-19 18:47:56 +08:00
tangbin
8c21e3313e aws listener sync fix 2020-02-19 18:47:56 +08:00
yunion-ci-robot
91d09aeba4 Merge pull request #5179 from rainzm/automated-cherry-pick-of-#5178-upstream-release-3.0
Automated cherry pick of #5178: fix(esxi): No distinction between ordinary scsi and pvscsi when creating disks
2020-02-19 17:51:29 +08:00
Rain
c040ed5d74 fix(esxi): No distinction between ordinary scsi and pvscsi when creating disks
parascsi 是 vmware 中一种高性能的 scsi 控制器。

在此之前,scsi 只包括 "lsilogic", "lsilogicsas", "buslogic"; 而别名为 pvscsi
的 parascsi 没有被包含进来;并且,一个 pci controller只能挂一个 scsi controller,
这会导致如果在一个拥有 pvscsi 的机器上添加普通scsi驱动类型的磁盘,就会替换驱动;
反之亦然。这会导致驱动的 key 不是我们指定的key,并且在添加磁盘的时候替换驱动的
类型有些随意。再者,我们的驱动类型的选择其实并没有暴露给前端。

所以,在寻找相应的controller时,将 parascsi 也纳入 scsi 类型。
尽量避免在创建磁盘的时候做硬件的改动,所以在创建磁盘的时候不区分 scsi
还是 pvscsi,如果两种 controller 均没有,就按照请求的类型创建一个。

此外,在 CloneVM 的时候,如果支持,优先使用 parascsi。
2020-02-19 16:58:27 +08:00
yunion-ci-robot
8b8f57e0f7 Merge pull request #5149 from tb365/automated-cherry-pick-of-#5145-upstream-release-3.0
Automated cherry pick of #5145: qcloud elb sync
2020-02-19 16:07:29 +08:00
Yousong Zhou
5c098c6445 Merge pull request #5176 from swordqiu/automated-cherry-pick-of-#5173-upstream-release-3.0
Automated cherry pick of #5173: fix: sync cloud provider should change its cloud account's sync_status
2020-02-19 16:02:43 +08:00
yunion-ci-robot
f4673ee5fc Merge pull request #5165 from tb365/automated-cherry-pick-of-#5162-upstream-release-3.0
Automated cherry pick of #5162: huawei elb backend vpc validate fix
2020-02-19 13:43:29 +08:00
yunion-ci-robot
410e575d8a Merge pull request #5169 from ioito/automated-cherry-pick-of-#5167-upstream-release-3.0
Automated cherry pick of #5167: fix: 避免将虚拟机ip同步到弹性网卡
2020-02-19 12:35:27 +08:00
yunion-ci-robot
16b053349b Merge pull request #5172 from yousong/automated-cherry-pick-of-#5159-upstream-release-3.0
Automated cherry pick of #5159: region: lbagent: deploy: use 'public' endpoint type
2020-02-19 12:04:27 +08:00
Qiu Jian
4937dec5f3 fix: sync cloud provider should change its cloud account's sync_status 2020-02-19 12:02:14 +08:00
Zexi Li
19b98799a0 Merge pull request #5157 from swordqiu/automated-cherry-pick-of-#5156-upstream-release-3.0
Automated cherry pick of #5156: fix: add climc helper scripts into docker images
2020-02-19 02:32:51 +08:00
Zexi Li
ce44e085f8 Merge pull request #5154 from swordqiu/automated-cherry-pick-of-#5151-upstream-release-3.0
Automated cherry pick of #5151: fix: 1. adjust default response header timer to 30 seconds 2. set default paging limit to 20
2020-02-19 02:30:04 +08:00
Yousong Zhou
349c26f39a lbagent: fix config for sticky session cookie
- account for user specific cookie name for insert mode
 - dont tamper cache instructions from backend server for server mode
2020-02-18 20:55:34 +08:00
Yousong Zhou
76d40b0ceb region: lbagent: deploy: use 'public' endpoint type 2020-02-18 20:55:34 +08:00
Qu Xuan
095b70af37 fix: 避免将虚拟机ip同步到弹性网卡 2020-02-18 15:39:26 +08:00
yunion-ci-robot
d090073168 Merge pull request #5140 from ioito/automated-cherry-pick-of-#5138-upstream-release-3.0
Automated cherry pick of #5138: fix: 避免未过滤掉同一个network底下的guest
2020-02-18 14:45:39 +08:00
tangbin
19fda5387f huawei elb backend vpc validate fix 2020-02-18 14:21:02 +08:00
yunion-ci-robot
617cd67b1c Merge pull request #5134 from zhaoxiangchun/automated-cherry-pick-of-#5132-upstream-release-3.0
Automated cherry pick of #5132: zstack监控功能
2020-02-18 12:06:44 +08:00
Qiu Jian
ae63c797d4 fix: add climc helper scripts into docker images 2020-02-18 10:16:56 +08:00
Qiu Jian
51e2c1114a fix: 1. adjust default response header timer to 30 seconds 2. set default paging limit to 20 2020-02-18 08:55:23 +08:00
TangBin
518405e0ca qcloud elb sync 2020-02-17 22:32:25 +08:00
Qu Xuan
e75c0e0fbf fix: 避免未过滤掉同一个network底下的guest 2020-02-17 20:52:34 +08:00
zhaoxiangchun
0c8fc8cf77 zstack监控功能
monitor.go中GetMonitorData函数通过传入的参数拼装请求参数,然后调用zstack.go中的getMonitor(),通过GET请求,获取相应的指标监控数据
2020-02-17 12:02:37 +08:00
yunion-ci-robot
5a2ecc2a1e Merge pull request #5122 from rainzm/automated-cherry-pick-of-#5121-upstream-release-3.0
Automated cherry pick of #5121: fix(esxiagent): Delete image backup file after saving to glance instead of before
2020-02-14 17:42:05 +08:00
Rain
8437d918de fix(esxiagent): Delete image backup file after saving to glance instead of before 2020-02-14 17:16:42 +08:00
yunion-ci-robot
ad9f85ede8 Merge pull request #5119 from ioito/automated-cherry-pick-of-#5117-upstream-release-3.0
Automated cherry pick of #5117: fix: 谷歌新加region翻译
2020-02-14 16:11:04 +08:00
Qu Xuan
e21994d9eb fix: 谷歌新加region翻译 2020-02-14 14:45:00 +08:00
yunion-ci-robot
8eca54f6a7 Merge pull request #5109 from rainzm/automated-cherry-pick-of-#5106-upstream-release-3.0
Automated cherry pick of #5106: fix(notify): Set some default template
2020-02-14 12:21:04 +08:00
yunion-ci-robot
7db5fe8ef7 Merge pull request #5113 from zexi/automated-cherry-pick-of-#5111-upstream-release-3.0
Automated cherry pick of #5111: region: server list by host sn
2020-02-14 12:08:05 +08:00
Zexi Li
320a233155 region: server list by host sn 2020-02-13 21:15:01 +08:00
Rain
60861d4983 fix(notify): Set some default template 2020-02-13 16:53:52 +08:00
yunion-ci-robot
599345c5f0 Merge pull request #5091 from rainzm/automated-cherry-pick-of-#5087-upstream-release-3.0
Automated cherry pick of #5087: fix(esxi): Create one if no suitable driver when creating disk
2020-02-13 14:37:02 +08:00
yunion-ci-robot
9159eae068 Merge pull request #5095 from bistuzx/automated-cherry-pick-of-#5092-upstream-release-3.0
Automated cherry pick of #5092: update account bucket options
2020-02-13 03:48:03 +08:00
张旭
8dc56cd712 update account bucket options 2020-02-12 18:28:58 +08:00
Rain
06ef435ffc fix: resolve compatibility issues 2020-02-12 17:18:10 +08:00
Rain
af4cab0d4e fix(esxi): Create one if no suitable driver when creating disk 2020-02-12 17:16:54 +08:00
yunion-ci-robot
1d4ea408a5 Merge pull request #5063 from zhaoxiangchun/automated-cherry-pick-of-#5061-upstream-release-3.0
Automated cherry pick of #5061: multicloud的vmware监控功能
2020-02-12 15:22:03 +08:00
yunion-ci-robot
b8f05c4ead Merge pull request #5079 from ioito/automated-cherry-pick-of-#5077-upstream-release-3.0
Automated cherry pick of #5077: fix: 修复gcp出方向规则同步问题
2020-02-11 17:39:59 +08:00
yunion-ci-robot
5c587212bc Merge pull request #5074 from ioito/automated-cherry-pick-of-#5072-upstream-release-3.0
Automated cherry pick of #5072: fix: 忽略无权限的资源标签
2020-02-11 17:22:02 +08:00
zhaoxiangchun
133fe47634 multicloud的vmware监控功能
monitor.go中GetMonitorData()函数获取监控数据
2020-02-11 00:45:28 +08:00
Qu Xuan
8efe1c5b45 fix: 修复gcp出方向规则同步问题 2020-02-10 18:48:18 +08:00
Qu Xuan
91ca20d540 fix: 忽略无权限的资源标签 2020-02-10 16:44:56 +08:00
yunion-ci-robot
4d320a22db Merge pull request #5070 from swordqiu/automated-cherry-pick-of-#5065-upstream-release-3.0
Automated cherry pick of #5065: fix: allow empty domain for windows deployment
2020-02-10 10:32:57 +08:00
Qiu Jian
16702ba2f6 fix: allow empty domain for windows deployment 2020-02-10 09:24:35 +08:00
yunion-ci-robot
e227380071 Merge pull request #5056 from swordqiu/automated-cherry-pick-of-#5054-upstream-release-3.0
Automated cherry pick of #5054: fix: createdAt should not be synced when update
2020-02-09 22:08:57 +08:00
Qiu Jian
b5aa5f3682 fix: createdAt should not be synced when update 2020-02-08 21:29:42 +08:00
yunion-ci-robot
7a56e6b74b Merge pull request #5046 from ioito/automated-cherry-pick-of-#5044-upstream-release-3.0
Automated cherry pick of #5044: fix: guest创建兼容keypair参数
2020-02-07 16:03:51 +08:00
Qu Xuan
4fd186a0c0 fix: guest创建兼容keypair参数 2020-02-07 15:12:29 +08:00
Zexi Li
88e4de7b52 Merge pull request #5028 from swordqiu/automated-cherry-pick-of-#5026-upstream-release-3.0
Automated cherry pick of #5026: fix: api gateway rpc handler redudant response
2020-02-07 13:03:31 +08:00
yunion-ci-robot
8bcbd08741 Merge pull request #5040 from ioito/automated-cherry-pick-of-#5038-upstream-release-3.0
Automated cherry pick of #5038: fix: 避免因tenantcache未缓存tenant导致创建云账号失败
2020-02-07 04:54:51 +08:00
yunion-ci-robot
3dc838d47d Merge pull request #5036 from tb365/automated-cherry-pick-of-#5032-upstream-release-3.0
Automated cherry pick of #5032: aws create with eip fix
2020-02-07 04:50:51 +08:00
Qu Xuan
abb954c6c9 fix: 避免因tenantcache未缓存tenant导致创建云账号失败 2020-02-06 18:29:36 +08:00
tangbin
b70a1e5a05 aws create with eip fix 2020-02-06 17:57:55 +08:00
Qiu Jian
5afb250467 fix: api gateway rpc handler redudant response 2020-02-06 17:02:42 +08:00
yunion-ci-robot
394a6f061c Merge pull request #5023 from ioito/automated-cherry-pick-of-#5021-upstream-release-3.0
Automated cherry pick of #5021: fix: 避免因大小写导致linux未注入默认用户
2020-02-06 13:50:52 +08:00
Qu Xuan
fa0cb45ea3 fix: 避免因大小写导致linux未注入默认用户 2020-02-06 12:03:48 +08:00
yunion-ci-robot
1113dfe17b Merge pull request #5019 from swordqiu/automated-cherry-pick-of-#5014-upstream-release-3.0
Automated cherry pick of #5014: fix: support empty dns domain
2020-02-06 09:42:49 +08:00
Qiu Jian
81c31c8c1c fix: support empty dns domain 2020-02-06 03:27:59 +08:00
yunion-ci-robot
8dfad23c2c Merge pull request #4998 from zhaoxiangchun/automated-cherry-pick-of-#4996-upstream-release-3.0
Automated cherry pick of #4996: azure的主机监控信息的获取
2020-02-05 02:11:45 +08:00
zhaoxiangchun
019287b16a modify files by github comments 2020-02-04 10:25:42 +08:00
zhaoxiangchun
ff1dc42c47 azure的主机监控信息的获取
monitor.go中的GetMonitorData函数完成参数的组装,查询获取监控信息
2020-02-04 10:25:42 +08:00
yunion-ci-robot
a3faf13ce7 Merge pull request #5000 from ioito/automated-cherry-pick-of-#4999-upstream-release-3.0
Automated cherry pick of #4999: fix: 避免私有云调整配置匹配不到sku
2020-02-03 16:18:44 +08:00
Qu Xuan
78d7317daa fix: 避免私有云调整配置匹配不到sku 2020-02-03 12:20:54 +08:00
yunion-ci-robot
dc6eab6cd1 Merge pull request #4995 from rainzm/automated-cherry-pick-of-#4994-upstream-release-3.0
Automated cherry pick of #4994: fix(esxiagent): Lead to vCenter server '503' when deleting vm'disk
2020-01-19 23:50:20 +08:00
Rain
48008e1a41 fix(esxiagent): Lead to vCenter server '503' when deleting vm'disk 2020-01-19 18:10:31 +08:00
Zexi Li
8f971c9ce4 Merge pull request #4993 from swordqiu/automated-cherry-pick-of-#4991-upstream-release-3.0
Automated cherry pick of #4991: update vendor
2020-01-19 17:35:33 +08:00
Qiu Jian
dbb4912325 fix: increment paging list order by multiple columns 2020-01-19 17:25:30 +08:00
Qiu Jian
9fdb7cf895 update vendor 2020-01-19 17:25:30 +08:00
yunion-ci-robot
05465b9cbb Merge pull request #4990 from swordqiu/automated-cherry-pick-of-#4988-upstream-release-3.0
Automated cherry pick of #4988: fix: cloudevent_tbl use new primary column event_id
2020-01-19 14:24:14 +08:00
Qiu Jian
e0ee61b94e fix: cloudevent_tbl use new primary column event_id 2020-01-19 12:56:40 +08:00
yunion-ci-robot
6032301cb8 Merge pull request #4979 from tb365/automated-cherry-pick-of-#4977-upstream-release-3.0
Automated cherry pick of #4977: get login-info add 404 return & elasticcache account reset password api add input params
2020-01-19 11:43:12 +08:00
Zexi Li
3894d23991 Merge pull request #4986 from swordqiu/automated-cherry-pick-of-#4983-upstream-release-3.0
Automated cherry pick of #4983: fix: try allocate host access ip from reserved pool
2020-01-19 10:37:40 +08:00
yunion-ci-robot
ae01139c37 Merge pull request #4900 from yousong/automated-cherry-pick-of-#4899-upstream-release-3.0
Automated cherry pick of #4899: validators: ValidatorModelIdOrName: allow empty
2020-01-19 10:29:11 +08:00
yunion-ci-robot
cb9e156628 Merge pull request #4890 from yousong/automated-cherry-pick-of-#4885-upstream-release-3.0
Automated cherry pick of #4885: lb: regiondrivers: remove unneeded Optional(true) call
2020-01-19 10:24:12 +08:00
Qiu Jian
57c266e977 fix: try allocate host access ip from reserved pool 2020-01-19 00:26:42 +08:00
Zexi Li
b1b9c08ea2 Merge pull request #4981 from wanyaoqi/automated-cherry-pick-of-#4980-upstream-release-3.0
Automated cherry pick of #4980: is standard domain optional
2020-01-18 19:16:33 +08:00
wanyaoqi
cc3f382cb8 is standard domain optional 2020-01-18 19:12:21 +08:00
TangBin
f2380b293e get login-info add 404 return & elasticcache account reset password api add input params 2020-01-18 18:39:53 +08:00
yunion-ci-robot
46a7e670b2 Merge pull request #4966 from ioito/automated-cherry-pick-of-#4965-upstream-release-3.0
Automated cherry pick of #4965: fix: 公有云日志添加brand字段
2020-01-18 16:26:10 +08:00
Zexi Li
af7aaff4c9 Merge pull request #4975 from swordqiu/automated-cherry-pick-of-#4973-upstream-release-3.0
Automated cherry pick of #4973: fix: bucket get details missing cloudprovider info
2020-01-18 16:03:58 +08:00
Qu Xuan
7c5f0727b3 fix: 公有云日志添加brand字段 2020-01-18 16:01:00 +08:00
Qiu Jian
c4f6199890 fix: bucket get details missing cloudprovider info 2020-01-18 15:42:59 +08:00
Zexi Li
5f3faf8cb8 Merge pull request #4971 from swordqiu/automated-cherry-pick-of-#4968-upstream-release-3.0
Automated cherry pick of #4968: fix: network-reserve-ip ignores expired reserved ips
2020-01-18 14:25:00 +08:00
Qiu Jian
d7becf89e8 fix: network-reserve-ip ignores expired reserved ips 2020-01-18 11:10:49 +08:00
Zexi Li
d35e6f8fea Merge pull request #4963 from wanyaoqi/automated-cherry-pick-of-#4962-upstream-release-3.0
Automated cherry pick of #4962: fix models renew
2020-01-17 21:55:27 +08:00
wanyaoqi
a3332344a0 fix models renew 2020-01-17 21:51:30 +08:00
yunion-ci-robot
5826a36de4 Merge pull request #4961 from yousong/automated-cherry-pick-of-#4960-upstream-release-3.0
Automated cherry pick of #4960: hostman: linux_bridge: flush addr on member iface down
2020-01-17 21:50:09 +08:00
yunion-ci-robot
b61befef30 Merge pull request #4947 from ioito/automated-cherry-pick-of-#4946-upstream-release-3.0
Automated cherry pick of #4946: fix: 腾讯云主机带宽跟随eip带宽变化而变化
2020-01-17 19:46:09 +08:00
yunion-ci-robot
4bdf3e8404 Merge pull request #4793 from zhaoxiangchun/automated-cherry-pick-of-#4775-upstream-release-3.0
Automated cherry pick of #4775: 新增aws监控代码,GetMonitorData函数,获取监控信息
2020-01-17 19:26:08 +08:00
Zexi Li
00e1911d30 Merge pull request #4958 from wanyaoqi/automated-cherry-pick-of-#4957-upstream-release-3.0
Automated cherry pick of #4957: fix postpaid expire
2020-01-17 18:57:04 +08:00
Yousong Zhou
d26c428b68 hostman: linux_bridge: flush addr on member iface down
Previously it was done by "ifconfig xx 0.0.0.0 down"

Fixes 4d8d20f ("hostman: use package iproute2")
2020-01-17 18:13:10 +08:00
yunion-ci-robot
dc634ad9d0 Merge pull request #4956 from yousong/automated-cherry-pick-of-#4955-upstream-release-3.0
Automated cherry pick of #4955: esxi: dont import hostman pkgs
2020-01-17 18:07:09 +08:00
wanyaoqi
e691d63910 fix postpaid expire 2020-01-17 17:53:27 +08:00
Yousong Zhou
5c325bc6b7 esxi: dont import hostman pkgs
Fix building region on darwin
2020-01-17 16:54:54 +08:00
Zexi Li
00f07f128f Merge pull request #4952 from wanyaoqi/automated-cherry-pick-of-#4950-upstream-release-3.0
Automated cherry pick of #4950: host deployer base version up
2020-01-17 16:39:07 +08:00
wanyaoqi
fdc1bef92e host deployer base version up 2020-01-17 14:44:00 +08:00
yunion-ci-robot
181c1099fe Merge pull request #4936 from yousong/automated-cherry-pick-of-#4935-upstream-release-3.0
Automated cherry pick of #4935: iproute2: test against non-nil dst of routes returned by List4()
2020-01-17 13:48:10 +08:00
Qu Xuan
e20a6a35df fix: 腾讯云主机带宽跟随eip带宽变化而变化 2020-01-17 13:35:10 +08:00
yunion-ci-robot
a4db9de855 Merge pull request #4944 from wanyaoqi/automated-cherry-pick-of-#4943-upstream-release-3.0
Automated cherry pick of #4943: fix snapshot list filter by disk type
2020-01-17 12:59:08 +08:00
wanyaoqi
4e9ca42347 fix snapshot list filter by disk type 2020-01-17 11:59:22 +08:00
yunion-ci-robot
10a04b0005 Merge pull request #4884 from tb365/automated-cherry-pick-of-#4880-upstream-release-3.0
Automated cherry pick of #4880: huawei remove backend group bugfix
2020-01-17 11:01:10 +08:00
yunion-ci-robot
f36f275dc6 Merge pull request #4923 from wanyaoqi/automated-cherry-pick-of-#4922-upstream-release-3.0
Automated cherry pick of #4922: fix detect host info
2020-01-17 10:55:09 +08:00
yunion-ci-robot
4f644f1d80 Merge pull request #4937 from rainzm/automated-cherry-pick-of-#4931-upstream-release-3.0
Automated cherry pick of #4931: bugfix(esxiagent): PrefetchImageCacheByCopy & SHost.FileUrlPathToDsPath
2020-01-17 10:54:10 +08:00
zhaoxiangchun
e1020530e2 add License Head 2020-01-17 10:48:35 +08:00
zhaoxiangchun
a94f55ba91 vendor: update 2020-01-17 10:48:35 +08:00
zhaoxiangchun
b769399a79 新增aws监控代码,GetMonitorData函数,获取监控信息
首先通过monitor.go文件中的GetMonitorData函数组装查询参数,然后通过SRegion中cloudWatchRequest函数组装request信息,
进行查询返回
2020-01-17 10:48:35 +08:00
Rain
0ba856004f bugfix(esxiagent): PrefetchImageCacheByCopy & SHost.FileUrlPathToDsPath
1. Fix the bug when preparing remote image by copy
2. SHost.FileUrlPathToDsPath will not work when shost has multiple storage.
2020-01-17 10:41:00 +08:00
Rain
afefb9464d bugfix(esxiagent): PrefetchImageCacheByCopy & SHost.FileUrlPathToDsPath
1. Fix the bug when preparing remote image by copy
2. SHost.FileUrlPathToDsPath will not work when shost has multiple storage.
2020-01-17 10:41:00 +08:00
yunion-ci-robot
039d7b43f6 Merge pull request #4927 from ioito/automated-cherry-pick-of-#4926-upstream-release-3.0
Automated cherry pick of #4926: cloudevent 支持since until参数过滤
2020-01-17 09:21:07 +08:00
Yousong Zhou
6a4b39085c netutils2: guard against possible nil members 2020-01-16 22:50:01 +08:00
Yousong Zhou
db75a24f73 netutils: DefaultSrcIpDev: use iproute2.RouteGetByDst 2020-01-16 22:50:01 +08:00
Yousong Zhou
ff0e50cce0 iproute2: add RouteGetByDst() 2020-01-16 22:50:01 +08:00
Yousong Zhou
217670326b iproute2: test against non-nil dst of routes returned by List4() 2020-01-16 22:50:01 +08:00
yunion-ci-robot
a655afbbde Merge pull request #4934 from rainzm/automated-cherry-pick-of-#4933-upstream-release-3.0
Automated cherry pick of #4933: fix(hostdeployer): Umount VDDKDisk when IRootFsDriver is nil
2020-01-16 21:48:11 +08:00
yunion-ci-robot
e276ba9582 Merge pull request #4930 from yousong/automated-cherry-pick-of-#4929-upstream-release-3.0
Automated cherry pick of #4929: hostman: fix removing addresses on slave ifaces
2020-01-16 21:24:11 +08:00
Rain
93c5a79afa fix(hostdeployer): Umount VDDKDisk when IRootFsDriver is nil 2020-01-16 21:21:19 +08:00
Yousong Zhou
53f95f775d hostman: replace route command dep with netlink call 2020-01-16 20:48:10 +08:00
Yousong Zhou
b9bab969cb netutils2: replace GetRoutes with netlink call 2020-01-16 20:48:10 +08:00
Yousong Zhou
7835ee1063 iproute2: route operations 2020-01-16 20:48:10 +08:00
Yousong Zhou
675f111084 hostman: add secondary addresses with one iproute2 call 2020-01-16 20:48:10 +08:00
Yousong Zhou
9ccd97a236 hostman: up bridge interface in SetupAddresses
Previously it was done implicitly by ifconfig addr config command
2020-01-16 20:48:10 +08:00
Yousong Zhou
2ea614d38d hostman: fix removing addresses on slave ifaces
Previously it was done with "ifconfig xxx 0 up"

Fixes 4d8d20f ("hostman: use package iproute2")
2020-01-16 20:48:10 +08:00
Qu Xuan
8028577a0b cloudevent 支持since until参数过滤 2020-01-16 19:44:38 +08:00
yunion-ci-robot
7c60fbf66c Merge pull request #4920 from yousong/automated-cherry-pick-of-#4919-upstream-release-3.0
Automated cherry pick of #4919: iproute2: skip setting addrs on parse error
2020-01-16 16:53:07 +08:00
wanyaoqi
bd560a07b6 fix detect host info 2020-01-16 16:50:30 +08:00
Yousong Zhou
a4507e169a netutils: isolate linux dependent parts 2020-01-16 16:35:12 +08:00
Yousong Zhou
a71292cabc iproute2: skip setting addrs on parse error 2020-01-16 16:35:12 +08:00
Yousong Zhou
b8d93a0db7 hostman: fix setting address
Fixes 4d8d20f ("hostman: use package iproute2")
2020-01-16 16:35:12 +08:00
Zexi Li
352800c78d Merge pull request #4915 from wanyaoqi/automated-cherry-pick-of-#4914-upstream-release-3.0
Automated cherry pick of #4914: fix deploy iso failed
2020-01-16 15:33:02 +08:00
yunion-ci-robot
a5ace62220 Merge pull request #4918 from tb365/automated-cherry-pick-of-#4916-upstream-release-3.0
Automated cherry pick of #4916: ctyun bugfix
2020-01-16 15:08:08 +08:00
TangBin
7f20eed8ef comment fix 2020-01-16 14:51:25 +08:00
TangBin
e2b1b53e3e ctyun bugfix 2020-01-16 14:51:25 +08:00
yunion-ci-robot
089652074e Merge pull request #4863 from yousong/automated-cherry-pick-of-#4836-upstream-release-3.0
Automated cherry pick of #4836: iproute2: initial version
2020-01-16 09:59:06 +08:00
yunion-ci-robot
77494e5889 Merge pull request #4913 from tb365/automated-cherry-pick-of-#4911-upstream-release-3.0
Automated cherry pick of #4911: server get login info 404 not found
2020-01-16 09:52:06 +08:00
yunion-ci-robot
ba8142559c Merge pull request #4905 from ioito/automated-cherry-pick-of-#4904-upstream-release-3.0
Automated cherry pick of #4904: fix: 避免创建azure时指定高级ssd失效
2020-01-16 09:51:06 +08:00
wanyaoqi
23515d0c87 fix deploy iso failed 2020-01-15 20:58:36 +08:00
yunion-ci-robot
3a853545ca Merge pull request #4891 from wanyaoqi/automated-cherry-pick-of-#4887-upstream-release-3.0
Automated cherry pick of #4887: validate share on delete, update pulibc scope on mark standard
2020-01-15 20:57:17 +08:00
TangBin
45d1c3c7dd server get login info 404 not found 2020-01-15 19:34:25 +08:00
Qu Xuan
277a1066cd fix: 避免创建azure时指定高级ssd失效 2020-01-15 18:01:25 +08:00
Zexi Li
cb29e4f045 Merge pull request #4903 from wanyaoqi/automated-cherry-pick-of-#4902-upstream-release-3.0
Automated cherry pick of #4902: use executor probe kernel mods
2020-01-15 17:30:23 +08:00
wanyaoqi
753566d3a9 use executor probe kernel mods 2020-01-15 17:20:29 +08:00
Yousong Zhou
4008c25b0a lbagent: tunable tune.http.maxhdr 2020-01-15 12:14:56 +08:00
Yousong Zhou
dad753aaf5 lbagent: fix not logging https listener 2020-01-15 12:14:56 +08:00
Yousong Zhou
6672c2357e lbagent: support accessing backend with tls 2020-01-15 12:14:56 +08:00
Yousong Zhou
5865e393f5 climc: lbbackend: support ssl related options 2020-01-15 12:14:56 +08:00
Yousong Zhou
3d6a14b89b lb: support accessing backend with tls 2020-01-15 12:14:56 +08:00
Yousong Zhou
3af6da558f lb: regiondrivers: remove unneeded Optional(true) call 2020-01-15 12:14:56 +08:00
Yousong Zhou
1e1811c0de hostman: use package iproute2 2020-01-14 21:42:21 +08:00
Yousong Zhou
5b09a45437 hostman: fix setting mtu for tunnel padding 2020-01-14 21:42:21 +08:00
Yousong Zhou
c72322cd5b hostman: hostinfo: use netutils2.DefaultSrcIpDev() 2020-01-14 21:42:21 +08:00
Yousong Zhou
bf5f1f524e vendor: add github.com/vishvananda/netlink 2020-01-14 21:42:21 +08:00
Yousong Zhou
e910967798 netutils2: use netlink to GetAddresses() 2020-01-14 21:42:20 +08:00
Yousong Zhou
aa27f4eeca netutils2: add DefaultSrcIpDev() 2020-01-14 21:42:20 +08:00
Yousong Zhou
232df7b869 iproute2: initial version 2020-01-14 21:42:20 +08:00
Yousong Zhou
88def49fcc climc: lblistener: allow setting backendgroup to empty 2020-01-14 21:38:34 +08:00
Yousong Zhou
fc3aa2acbf mcclient: options: test marshal string ptr 2020-01-14 21:38:34 +08:00
Yousong Zhou
7bb8f0f968 lblistener: allow setting http/https listener backendgroup to empty 2020-01-14 21:38:34 +08:00
Yousong Zhou
79d8abd1ab validators: ValidatorModelIdOrName: allow empty 2020-01-14 21:38:34 +08:00
Zexi Li
101d5de95a Merge pull request #4898 from rainzm/automated-cherry-pick-of-#4895-upstream-release-3.0
Automated cherry pick of #4895: fix(notify): Update template
2020-01-14 18:23:52 +08:00
Rain
11ccfdd5c9 fix(notify): Update template 2020-01-14 18:17:06 +08:00
wanyaoqi
05c85e898d validate share on delete, update pulibc scope on mark standard 2020-01-14 17:41:42 +08:00
Zexi Li
30a4d16628 Merge pull request #4889 from wanyaoqi/automated-cherry-pick-of-#4888-upstream-release-3.0
Automated cherry pick of #4888: host fix env path
2020-01-14 17:35:25 +08:00
wanyaoqi
f9b9856768 host fix env path 2020-01-14 17:20:52 +08:00
TangBin
60b0634e27 aliyun backendgroup bugfix 2020-01-14 15:53:24 +08:00
TangBin
8f574c255d aws backendgroup delete bugfix 2020-01-14 15:53:24 +08:00
TangBin
37ece22817 aws sync routetable 2020-01-14 15:53:24 +08:00
TangBin
e25142ed70 huawei remove backend group bugfix 2020-01-14 15:53:24 +08:00
Zexi Li
e59189d0f5 Merge pull request #4875 from yousong/automated-cherry-pick-of-#4874-upstream-release-3.0
Automated cherry pick of #4874: vendor: update sqlchemy
2020-01-14 13:58:00 +08:00
Zexi Li
5e166849ef Merge pull request #4879 from yousong/automated-cherry-pick-of-#4878-upstream-release-3.0
Automated cherry pick of #4878: lb: fix setting default redirect type
2020-01-14 13:57:23 +08:00
Yousong Zhou
f5af866b39 lb: fix setting default redirect type 2020-01-14 13:32:39 +08:00
Yousong Zhou
5773663e5d vendor: update sqlchemy 2020-01-14 13:26:14 +08:00
Zexi Li
b65ab0361a Merge pull request #4872 from swordqiu/automated-cherry-pick-of-#4869-upstream-release-3.0
Automated cherry pick of #4869: fix: first load of service config not effective
2020-01-14 10:23:49 +08:00
Qiu Jian
eb30360856 fix: first load of service config not effective 2020-01-14 03:04:19 +08:00
yunion-ci-robot
08b7a96309 Merge pull request #4864 from ioito/automated-cherry-pick-of-#4862-upstream-release-3.0
Automated cherry pick of #4862: fix: 仅kvm需要去判断是否需要关机调整配置,公有云私有云默认不需要
2020-01-14 03:02:01 +08:00
yunion-ci-robot
fe99ec0649 Merge pull request #4838 from ioito/automated-cherry-pick-of-#4837-upstream-release-3.0
Automated cherry pick of #4837: fix: 添加磁盘创建失败日志
2020-01-14 02:58:01 +08:00
yunion-ci-robot
f885cfcc4a Merge pull request #4859 from ioito/automated-cherry-pick-of-#4858-upstream-release-3.0
Automated cherry pick of #4858: fix: 恢复公有云日志name
2020-01-14 02:51:02 +08:00
yunion-ci-robot
9b3491cc4e Merge pull request #4830 from ioito/automated-cherry-pick-of-#4829-upstream-release-3.0
Automated cherry pick of #4829: fix: 公有云日志权限列表
2020-01-14 02:31:01 +08:00
yunion-ci-robot
5317b43e13 Merge pull request #4850 from ioito/automated-cherry-pick-of-#4849-upstream-release-3.0
Automated cherry pick of #4849: fix: aliyun rule fix
2020-01-14 02:24:01 +08:00
yunion-ci-robot
633c2c9439 Merge pull request #4800 from yousong/automated-cherry-pick-of-#4799-upstream-release-3.0
Automated cherry pick of #4799: validators: remove unused defaultVal member
2020-01-14 02:04:01 +08:00
Zexi Li
3f15fa2c58 Merge pull request #4843 from ioito/automated-cherry-pick-of-#4842-upstream-release-3.0
Automated cherry pick of #4842: fix: 添加安全组操作日志
2020-01-13 20:50:49 +08:00
Zexi Li
b822c58fc2 Merge pull request #4857 from rainzm/automated-cherry-pick-of-#4856-upstream-release-3.0
Automated cherry pick of #4856: fix(esxi-agent): Export CGO_ENABLED=0 when building esxi-agent
2020-01-13 20:49:25 +08:00
Rain
5171eca046 fix(esxi-agent): Export CGO_ENABLED=0 when building esxi-agent 2020-01-13 20:45:24 +08:00
Qu Xuan
bec1776d7e fix: 仅kvm需要去判断是否需要关机调整配置,公有云私有云默认不需要 2020-01-13 18:53:04 +08:00
Qu Xuan
5ba580878d fix: 恢复公有云日志name 2020-01-13 17:58:03 +08:00
Qu Xuan
7ee21d12ce fix: aliyun rule fix 2020-01-13 17:44:07 +08:00
Qu Xuan
abef1a9f9b fix: 添加安全组操作日志 2020-01-13 15:26:31 +08:00
Qu Xuan
ccd187220c fix: 添加磁盘创建失败日志 2020-01-13 14:54:29 +08:00
yunion-ci-robot
40a211144c Merge pull request #4835 from zexi/automated-cherry-pick-of-#4834-upstream-release-3.0
Automated cherry pick of #4834: action: add esxi agent
2020-01-13 13:28:02 +08:00
Zexi Li
7648c26d75 action: add esxi agent 2020-01-13 13:24:37 +08:00
Qu Xuan
2ee7dca684 fix: 公有云日志权限列表 2020-01-13 11:21:34 +08:00
Zexi Li
f764e5b394 Merge pull request #4820 from swordqiu/automated-cherry-pick-of-#4817-upstream-release-3.0
Automated cherry pick of #4817: fix: non-default-domain-projects changes not take effects after changing through service-config
2020-01-13 10:57:07 +08:00
Zexi Li
c260d81610 Merge pull request #4816 from swordqiu/automated-cherry-pick-of-#4813-upstream-release-3.0
Automated cherry pick of #4813: fix: set default read privileges for reading all quotas
2020-01-13 10:55:15 +08:00
yunion-ci-robot
ef813e062a Merge pull request #4825 from tb365/automated-cherry-pick-of-#4823-upstream-release-3.0
Automated cherry pick of #4823: sku domain filter bugfix
2020-01-13 09:26:59 +08:00
TangBin
2062489bec sku domain filter bugfix 2020-01-12 12:03:49 +08:00
Qiu Jian
0ae98e64ea fix: non-default-domain-projects changes not take effects after changing through service-config 2020-01-12 00:06:34 +08:00
yunion-ci-robot
a1ccae2e23 Merge pull request #4810 from tb365/automated-cherry-pick-of-#4809-upstream-release-3.0
Automated cherry pick of #4809: sku domain filter bugfix
2020-01-11 23:30:03 +08:00
TangBin
0b4a141199 sku domain filter bugfix 2020-01-11 21:29:05 +08:00
Qiu Jian
25f8c71d18 fix: set default read privileges for reading all quotas 2020-01-11 18:01:16 +08:00
Yousong Zhou
1a0df04c83 climc: lb: allow setting redirect parameters 2020-01-10 21:34:32 +08:00
Yousong Zhou
f5c534cb71 climc: lblistenerrule: allow setting request rate 2020-01-10 21:34:32 +08:00
Yousong Zhou
7d1174efad lbagent: support http redirect 2020-01-10 21:34:32 +08:00
Yousong Zhou
e3f654994a lb: support redirect type listener & rule 2020-01-10 21:34:32 +08:00
Yousong Zhou
0dbd73b60b lblistenerrule: validate domain and path on creation 2020-01-10 21:34:31 +08:00
Yousong Zhou
f75ef27fe0 validators: add ValidatorHostPort 2020-01-10 21:34:31 +08:00
Yousong Zhou
dca8b8a9f5 validators: add ValidatorIntChoices 2020-01-10 21:34:31 +08:00
Yousong Zhou
9df932505c validators: remove unused defaultVal member 2020-01-10 21:34:30 +08:00
yunion-ci-robot
423777c775 Merge pull request #4796 from tb365/automated-cherry-pick-of-#4795-upstream-release-3.0
Automated cherry pick of #4795: add filter skus by domain id
2020-01-10 20:25:58 +08:00
yunion-ci-robot
52f2a1f3b4 Merge pull request #4722 from tb365/automated-cherry-pick-of-#4712-upstream-release-3.0
Automated cherry pick of #4712: cloud account support manually sync skus
2020-01-10 20:06:59 +08:00
yunion-ci-robot
dd0ced571d Merge pull request #4806 from tb365/automated-cherry-pick-of-#4801-upstream-release-3.0
Automated cherry pick of #4801: kvm elb listener update bugfix
2020-01-10 19:50:58 +08:00
yunion-ci-robot
dbd959d040 Merge pull request #4767 from tb365/automated-cherry-pick-of-#4766-upstream-release-3.0
Automated cherry pick of #4766: _getModule fix
2020-01-10 19:22:59 +08:00
TangBin
9be50f0007 kvm elb listener update bugfix 2020-01-10 18:52:00 +08:00
TangBin
840b6e9a16 spelling mistakes fix 2020-01-10 17:17:25 +08:00
TangBin
ec83f583c2 user register ingore blank row 2020-01-10 17:17:25 +08:00
TangBin
2983659c53 add filter skus by domain id 2020-01-10 17:17:25 +08:00
Zexi Li
af20c84a50 Merge pull request #4794 from rainzm/automated-cherry-pick-of-#4779-upstream-release-3.0
Automated cherry pick of #4779: fix(esxi-agent): Avoid redundant agent & Adjust workspace path
2020-01-10 11:51:57 +08:00
Rain
5cee576fc4 fix(esxi-agent): Avoid redundant agent & Adjust workspace path
1. There is only one esxi agent needed in OneCloud.
2. Workspace path shoule be EsxiAgentPath not the parent directory of this.
3. The VM name is too long for vcenter when importing VM so that shrink
it.
2020-01-10 11:01:37 +08:00
yunion-ci-robot
ba89e19f3e Merge pull request #4778 from rainzm/automated-cherry-pick-of-#4754-upstream-release-3.0
Automated cherry pick of #4754: fix(region): Sync HostStorage in syncOnPremiseCloudProviderInfo
2020-01-10 10:36:58 +08:00
yunion-ci-robot
73faf76bbb Merge pull request #4762 from wanyaoqi/automated-cherry-pick-of-#4761-upstream-release-3.0
Automated cherry pick of #4761: image-properties-add-disable-delete
2020-01-10 10:28:58 +08:00
yunion-ci-robot
17bd125542 Merge pull request #4769 from wanyaoqi/automated-cherry-pick-of-#4768-upstream-release-3.0
Automated cherry pick of #4768: fix guest start no task complete
2020-01-10 10:22:58 +08:00
yunion-ci-robot
3b14136705 Merge pull request #4783 from swordqiu/automated-cherry-pick-of-#4780-upstream-release-3.0
Automated cherry pick of #4780: fix: initialize service config on keystone when service boot
2020-01-10 10:19:58 +08:00
yunion-ci-robot
a968e3544c Merge pull request #4785 from yousong/automated-cherry-pick-of-#4784-upstream-release-3.0
Automated cherry pick of #4784: dnsrecords: add helper methods
2020-01-10 10:15:57 +08:00
Yousong Zhou
9d20a58a85 dns: chain load records for cname 2020-01-09 23:23:34 +08:00
Yousong Zhou
a719ad6d82 dns: prepare for responding with A record of cname value 2020-01-09 23:23:34 +08:00
Yousong Zhou
2f9e3f7da0 dnsrecords: add helper methods 2020-01-09 23:23:34 +08:00
Qiu Jian
5f8758e5c4 fix: initialize service config on keystone when service boot 2020-01-09 22:15:27 +08:00
Rain
ae2369befd fix(region): Sync HostStorage in syncOnPremiseCloudProviderInfo
情景:绕过OneCloud,删除 storage 上的所有 vm 并且删除 storage 然后新建 storage。

问题:因为存在 vm 在使用此 storage ,所以在同步的时候,对应的 storage
会删除失败,并且阻止了 storagecache 的同步。这样在创建机器的时候,如果
使用旧的 storage 就会导致创建失败(因为此 Host 已经不再使用对应的
remote storage); 如果使用新的 storage 就会因为找不到对应的 storage cache 而失败。

修改:如果因为以上原因删除失败的 storage 的 storage_type 为 local
那么就把这个 storage 置为 offline,并且不再阻止 storage cache 的同步。
2020-01-09 21:04:32 +08:00
wanyaoqi
a4a7d004c8 fix guest start no task complete 2020-01-09 17:13:03 +08:00
TangBin
9a7d223311 _getModule fix 2020-01-09 16:42:16 +08:00
wanyaoqi
d9910a0364 image-properties-add-disable-delete 2020-01-09 15:42:02 +08:00
TangBin
6ad8ff188d cloud account support manually sync skus 2020-01-09 11:17:04 +08:00
yunion-ci-robot
641cd05a9a Merge pull request #4756 from rainzm/automated-cherry-pick-of-#4755-upstream-release-3.0
Automated cherry pick of #4755: fix(esxi-agent): Adjust the VM Path in Datastore
2020-01-09 10:28:57 +08:00
Zexi Li
570a6bbab7 Merge pull request #4760 from swordqiu/automated-cherry-pick-of-#4757-upstream-release-3.0
Automated cherry pick of #4757: fix: brand of compute quota key should be fixed
2020-01-09 09:58:54 +08:00
yunion-ci-robot
01a466b989 Merge pull request #4710 from wanyaoqi/automated-cherry-pick-of-#4709-upstream-release-3.0
Automated cherry pick of #4709: host misc fix
2020-01-09 00:05:58 +08:00
yunion-ci-robot
4fd7e6fcf0 Merge pull request #4725 from yousong/automated-cherry-pick-of-#4724-upstream-release-3.0
Automated cherry pick of #4724: wires: lift name length, charset constraint
2020-01-08 23:44:59 +08:00
Qiu Jian
8a2841f672 fix: brand of compute quota key should be fixed 2020-01-08 23:36:12 +08:00
yunion-ci-robot
0adccb5c8b Merge pull request #4751 from ioito/automated-cherry-pick-of-#4750-upstream-release-3.0
Automated cherry pick of #4750: fix: cloudevent 成功条件补充
2020-01-08 23:33:59 +08:00
Rain
a712df096a fix(esxi-agent): Adjust the VM Path in Datastore 2020-01-08 21:09:44 +08:00
Qu Xuan
ed75a7262b fix: cloudevent 成功条件补充 2020-01-08 20:44:13 +08:00
Zexi Li
adea5e3441 Merge pull request #4738 from swordqiu/automated-cherry-pick-of-#4735-upstream-release-3.0
Automated cherry pick of #4735: fix: misc quota bugs 1. snapshot pending usage not cleaned after created 2. server-attach-network error 3. loadbalancer fail to set cloudregion_id
2020-01-08 19:17:40 +08:00
Yousong Zhou
64f29934f0 wires: lift name length, charset constraint 2020-01-08 19:15:17 +08:00
yunion-ci-robot
6cc5c4d942 Merge pull request #4729 from ioito/automated-cherry-pick-of-#4728-upstream-release-3.0
Automated cherry pick of #4728: fix: eip duplicate name
2020-01-08 19:05:57 +08:00
Qiu Jian
e817fb0920 fix: misc quota bugs 1. snapshot pending usage not cleaned after created 2. server-attach-network error 3. loadbalancer fail to set cloudregion_id 2020-01-08 18:53:36 +08:00
Qu Xuan
2c412db6c8 fix: eip duplicate name 2020-01-08 18:11:15 +08:00
yunion-ci-robot
d08761095c Merge pull request #4699 from rainzm/automated-cherry-pick-of-#4695-upstream-release-3.0
Automated cherry pick of #4695: fix(glance): Cancel pending usage of image quota correctly
2020-01-08 16:11:58 +08:00
yunion-ci-robot
03cf19f1db Merge pull request #4705 from tb365/automated-cherry-pick-of-#4701-upstream-release-3.0
Automated cherry pick of #4701: azure skus sync fix
2020-01-08 15:53:59 +08:00
Zexi Li
3c77aa38ff Merge pull request #4715 from wanyaoqi/automated-cherry-pick-of-#4714-upstream-release-3.0
Automated cherry pick of #4714: set subimage some field nullable
2020-01-08 15:42:48 +08:00
wanyaoqi
d3a2ebeacb set subimage some field nullable 2020-01-08 15:36:44 +08:00
yunion-ci-robot
d868952b0d Merge pull request #4706 from ioito/automated-cherry-pick-of-#4655-upstream-release-3.0
Automated cherry pick of #4655: optimized: 优化公有云日志查询
2020-01-08 14:56:57 +08:00
wanyaoqi
9ac505c907 host misc fix 2020-01-08 14:22:18 +08:00
yunion-ci-robot
05ee08e411 Merge pull request #4684 from yousong/automated-cherry-pick-of-#4683-upstream-release-3.0
Automated cherry pick of #4683: hostman: distro name OpenWrt instead of OpenWRT
2020-01-08 12:57:59 +08:00
Qu Xuan
ef39ed3d0c optimized: 优化公有云日志查询 2020-01-08 11:46:38 +08:00
yunion-ci-robot
85ac87b7c9 Merge pull request #4651 from ioito/automated-cherry-pick-of-#4650-upstream-release-3.0
Automated cherry pick of #4650: fix: 避免创建rds account, database后未设置exteranl_id
2020-01-08 11:42:56 +08:00
yunion-ci-robot
3b3480b29b Merge pull request #4637 from ioito/automated-cherry-pick-of-#4636-upstream-release-3.0
Automated cherry pick of #4636: fix: 加强密码校验
2020-01-08 11:38:58 +08:00
TangBin
6628f15ab0 huawei redis sync fix 2020-01-08 11:34:42 +08:00
TangBin
9f55497161 ctyun default gateway fix 2020-01-08 11:34:42 +08:00
TangBin
9e96e4f7e4 huawei network default gateway fix 2020-01-08 11:34:42 +08:00
TangBin
12c87f630a network create GuestIpPrefix fix 2020-01-08 11:34:42 +08:00
TangBin
5d2fb3bf56 azure skus sync fix 2020-01-08 11:34:42 +08:00
Rain
af5b218377 fix(glance): Cancel pending usage of image quota correctly
ImageNumber always be zero because the 'image_number' in data was
removed so that canceling pending usage not work.
2020-01-08 11:33:32 +08:00
yunion-ci-robot
802197f161 Merge pull request #4642 from tb365/automated-cherry-pick-of-#4634-upstream-release-3.0
Automated cherry pick of #4634: huawei image delete bugfix
2020-01-08 11:26:59 +08:00
yunion-ci-robot
45f3ee7989 Merge pull request #4690 from ioito/automated-cherry-pick-of-#4685-upstream-release-3.0
Automated cherry pick of #4685: fix: next marker format
2020-01-08 10:09:57 +08:00
Zexi Li
d9a43ae92a Merge pull request #4682 from swordqiu/automated-cherry-pick-of-#4676-upstream-release-3.0
Automated cherry pick of #4676: fix: guest network default share scope should be system if non-default-domain-projects is off
2020-01-07 19:30:44 +08:00
Zexi Li
8ae4e5bcec Merge pull request #4675 from swordqiu/automated-cherry-pick-of-#4666-upstream-release-3.0
Automated cherry pick of #4666: fix: guess brand on guest create
2020-01-07 19:28:49 +08:00
yunion-ci-robot
67dd167835 Merge pull request #4665 from ioito/automated-cherry-pick-of-#4656-upstream-release-3.0
Automated cherry pick of #4656: fix: 避免拥有带宽包的腾讯云创建机器失败
2020-01-07 18:08:59 +08:00
Qu Xuan
2d1d8db96a fix: next marker format 2020-01-07 18:02:23 +08:00
Yousong Zhou
9e42b83406 hostman: openwrt: deploy public key for root 2020-01-07 18:00:34 +08:00
Yousong Zhou
1a16fbd9cf hostman: split DeployAuthorizedKeys() 2020-01-07 18:00:34 +08:00
Yousong Zhou
77d19d2ec3 hostman: openwrt: support deploy networking scripts 2020-01-07 18:00:34 +08:00
Yousong Zhou
5391943537 hostman: openwrt: deploy hostname with board config 2020-01-07 18:00:34 +08:00
Yousong Zhou
5c1044a1f6 hostman: distro name OpenWrt instead of OpenWRT 2020-01-07 18:00:34 +08:00
yunion-ci-robot
6e87e25b38 Merge pull request #4659 from ioito/automated-cherry-pick-of-#4658-upstream-release-3.0
Automated cherry pick of #4658: fix: 避免同步安全组失败后,没有任何日志记录
2020-01-07 17:09:57 +08:00
Qiu Jian
95565e4b6d fix: guest network default share scope should be system if non-default-domain-projects is off 2020-01-07 16:58:36 +08:00
Qiu Jian
6c0bdeac49 fix: guess brand on guest create 2020-01-07 15:13:40 +08:00
Qu Xuan
5100ced74c fix: 避免拥有带宽包的腾讯云创建机器失败 2020-01-07 14:59:11 +08:00
Qu Xuan
f022f4138e fix: 避免同步安全组失败后,没有任何日志记录 2020-01-07 11:48:43 +08:00
yunion-ci-robot
6ecf644277 Merge pull request #4639 from rainzm/automated-cherry-pick-of-#4635-upstream-release-3.0
Automated cherry pick of #4635: fix: Workmanager delayTaskWithoutReqctx
2020-01-07 09:33:56 +08:00
Rain
ee34fbdafe fix: Workmanager delayTaskWithoutReqctx
The context of delayTaskWithoutReqctx should have 'taskid' value.
2020-01-06 15:21:04 +08:00
yunion-ci-robot
61ff4ddbc8 Merge pull request #4649 from swordqiu/automated-cherry-pick-of-#4645-upstream-release-3.0
Automated cherry pick of #4645: fix: comment out TestDialTimeout
2020-01-06 15:12:59 +08:00
Qu Xuan
ec7bc017dd fix: 避免创建rds account, database后未设置exteranl_id 2020-01-06 13:38:09 +08:00
Qiu Jian
a96d17efcc fix: comment out TestDialTimeout 2020-01-06 13:12:04 +08:00
TangBin
ac1d08d619 huawei image delete bugfix 2020-01-06 11:52:49 +08:00
Qu Xuan
d032dccd91 fix: 加强密码校验 2020-01-06 11:45:03 +08:00
yunion-ci-robot
987495c463 Merge pull request #4633 from wanyaoqi/automated-cherry-pick-of-#4632-upstream-release-3.0
Automated cherry pick of #4632: host image support container deploy:
2020-01-05 19:10:39 +08:00
wanyaoqi
dc2fd237f0 host image support container deploy: 2020-01-05 18:52:11 +08:00
Zexi Li
03cca94b0c Merge pull request #4630 from swordqiu/automated-cherry-pick-of-#4627-upstream-release-3.0
Automated cherry pick of #4627: fix: increase default sync worker count from 2 to 5
2020-01-05 12:22:58 +08:00
Qiu Jian
3365161fa5 fix: increase default sync worker count from 2 to 5 2020-01-05 12:21:27 +08:00
Zexi Li
e810d4567e Merge pull request #4625 from swordqiu/automated-cherry-pick-of-#4601-upstream-release-3.0
Automated cherry pick of #4601: fix: remove bw/ebw quota limit
2020-01-04 23:59:38 +08:00
Qiu Jian
954341e4ab remove bw/ebw quota from scheduler 2020-01-04 23:35:42 +08:00
Qiu Jian
becfe078d5 fix: remove bw/ebw quota limit 2020-01-04 23:35:42 +08:00
Zexi Li
8915b934b1 Merge pull request #4622 from zexi/automated-cherry-pick-of-#4621-upstream-release-3.0
Automated cherry pick of #4621: fix: fmt error
2020-01-04 23:21:01 +08:00
Zexi Li
b67da6996f Merge pull request #4620 from swordqiu/automated-cherry-pick-of-#4616-upstream-release-3.0
Automated cherry pick of #4616: fix: huawei uncache image fail
2020-01-04 23:20:19 +08:00
Zexi Li
ce40f6378f Merge pull request #4610 from ioito/automated-cherry-pick-of-#4609-upstream-release-3.0
Automated cherry pick of #4609: fix: 避免仅删除value时,行为演变为删除标签
2020-01-04 23:17:56 +08:00
Zexi Li
2c2b1544c6 fix: fmt error 2020-01-04 23:12:39 +08:00
Qiu Jian
44114e8d94 fix: huawei uncache image fail 2020-01-04 23:03:53 +08:00
Zexi Li
b9405e72e7 Merge pull request #4608 from rainzm/automated-cherry-pick-of-#4602-upstream-release-3.0
Automated cherry pick of #4602: fix(notify): Fix the error of filter about contacts
2020-01-04 22:29:57 +08:00
Rain
3a5b32fc60 fix(notify): Fix the error of filter about contacts 2020-01-04 22:26:43 +08:00
Qu Xuan
9bbba1a3cc fix: 避免仅删除value时,行为演变为删除标签 2020-01-04 22:16:07 +08:00
Zexi Li
25277900d4 Merge pull request #4600 from rainzm/automated-cherry-pick-of-#4597-upstream-release-3.0
Automated cherry pick of #4597: fix(region): Add reset_password in guest template's ConfigInfo
2020-01-04 22:03:25 +08:00
Rain
4cdf779700 fix(region): Cancel the check about project when creating service catlog 2020-01-04 21:40:16 +08:00
Rain
dc09cb88c4 fix(region): Add reset_password in guest template's ConfigInfo 2020-01-04 21:40:16 +08:00
Zexi Li
155ef44d8f Merge pull request #4595 from rainzm/automated-cherry-pick-of-#4592-upstream-release-3.0
Automated cherry pick of #4592: fix(region): Fix that 'Can_delete' disappears due to parameter structuring
2020-01-04 21:10:02 +08:00
Zexi Li
e08b7ff91d Merge pull request #4591 from rainzm/automated-cherry-pick-of-#4588-upstream-release-3.0
Automated cherry pick of #4588: fix(region): Set normal's snapshotpolicy's status as ready
2020-01-04 21:09:41 +08:00
yunion-ci-robot
fa544dbdc7 Merge pull request #4596 from rainzm/automated-cherry-pick-of-#4419-upstream-release-3.0
Automated cherry pick of #4419: feature(esxi-agent): Esxi Agent Golang
2020-01-04 21:08:41 +08:00
Rain
67f0dc3f8b feature(esxi-agent): Esxi Agent Golang
1. 修改了host-deployer 使其支持 vmware vddk 的 deploy guest fs 操作。
2. esxi agent python ==> Go

fix(esxi-agent): Fix some bugs and irregular contents

fix(esxi-agent): Partial parameter structure

fix(esxi-agent): Add ovf template and remove some binary file

fix(esxi-agent): Format Code

fix(esxi-agent): fix based on reviewers' comments

fix(esxi-agent): fix host-deployer because of occasional unknown panic

fix: DelayTask should have a new Context

fix(esxi-agent): call hostutils.DelayTask

change '_interface' package to 'iagent' package

fix(esxi-agent): Fix some irregular code
2020-01-04 21:04:29 +08:00
Rain
d333e30d52 fix(region): Fix that 'Can_delete' disappears due to parameter structuring 2020-01-04 21:03:56 +08:00
Rain
94068ce53e feature(region): Add bind/unbind-snapshotpolicy api for disk 2020-01-04 21:00:33 +08:00
Rain
7a0b6fd2ee fix(region): Set normal's snapshotpolicy's status as ready 2020-01-04 21:00:33 +08:00
屈轩
c0115d5a9c fix: 子网删除忽略弹性网卡 (#4575) 2020-01-04 20:52:54 +08:00
Jian Qiu
50ea8fc5a8 Automated cherry pick of #4527: fix: httpclient timeout value cleanup, use notimeout client for oss (#4531)
* fix: httpclient timeout value cleanup, use notimeout client for oss

* Adaptive timeout client

* more test cases

* remove resolve timeout test case

* use adptive timeout only if timeout = 0
2020-01-04 20:52:25 +08:00
yunion-ci-robot
fec4cb1804 Merge pull request #4570 from bistuzx/automated-cherry-pick-of-#4557-upstream-release-3.0
Automated cherry pick of #4557: add cloud account create&update options
2020-01-04 20:28:43 +08:00
yunion-ci-robot
49b3bf2dce Merge pull request #4582 from ioito/automated-cherry-pick-of-#4581-upstream-release-3.0
Automated cherry pick of #4581: fix: 修复zstack安全组创建失败问题
2020-01-04 20:12:39 +08:00
yunion-ci-robot
b89a445451 Merge pull request #4559 from ioito/automated-cherry-pick-of-#4558-upstream-release-3.0
Automated cherry pick of #4558: fix: openstack eip dissociate optimized
2020-01-04 20:02:36 +08:00
Qu Xuan
d3a0e345d9 fix: 修复zstack安全组创建失败问题 2020-01-04 20:01:21 +08:00
Zexi Li
0542deef75 Merge pull request #4568 from swordqiu/automated-cherry-pick-of-#4564-upstream-release-3.0
Automated cherry pick of #4564: fix: minio fail to set object metadata
2020-01-04 19:52:52 +08:00
Zexi Li
0db77fc304 Merge pull request #4552 from swordqiu/automated-cherry-pick-of-#4549-upstream-release-3.0
Automated cherry pick of #4549: fix: domain quota-list include domain's own quota
2020-01-04 19:46:26 +08:00
Zexi Li
c6a8eae499 Merge pull request #4580 from zexi/automated-cherry-pick-of-#4579-upstream-release-3.0
Automated cherry pick of #4579: dockerfile: component use base image
2020-01-04 19:28:01 +08:00
Zexi Li
62f0a84a83 dockerfile: component use base image 2020-01-04 19:28:35 +08:00
张旭
aa6e9a8107 add cloud account create&update options 2020-01-04 19:19:06 +08:00
yunion-ci-robot
8528410bf8 Merge pull request #4554 from tb365/automated-cherry-pick-of-#4553-upstream-release-3.0
Automated cherry pick of #4553: elastic account add random password
2020-01-04 19:05:36 +08:00
Qu Xuan
d2f33742a0 fix: openstack eip dissociate optimized 2020-01-04 18:43:30 +08:00
Qiu Jian
b4b1494e1c fix: minio fail to set object metadata 2020-01-04 18:37:42 +08:00
TangBin
bb8c9d1b47 get eip bugfix 2020-01-04 18:23:22 +08:00
TangBin
ab1d2c0c24 get eip bugfix 2020-01-04 18:23:22 +08:00
TangBin
ef1b8f5245 host batch register bugfix 2020-01-04 18:23:22 +08:00
TangBin
8d1f755b4e elastic cache account add login info api 2020-01-04 18:23:22 +08:00
TangBin
ad32d9063a elastic account add random password 2020-01-04 18:23:22 +08:00
yunion-ci-robot
7ca467e35b Merge pull request #4538 from wanyaoqi/automated-cherry-pick-of-#4535-upstream-release-3.0
Automated cherry pick of #4535: fix disk filter by guest
2020-01-04 18:20:36 +08:00
Qiu Jian
8270238116 fix: domain quota-list include domain's own quota 2020-01-04 17:18:50 +08:00
Zexi Li
ac4f897510 Merge pull request #4544 from swordqiu/automated-cherry-pick-of-#4539-upstream-release-3.0
Automated cherry pick of #4539: fix: add cloudprovider capabilities
2020-01-04 17:03:35 +08:00
wanyaoqi
0eef43bb0a add recover on guest suddenly shotdown 2020-01-04 16:51:59 +08:00
Qiu Jian
5096ee9de3 minor fixes 2020-01-04 16:21:41 +08:00
Qiu Jian
34e0d8dd27 minor fixes 2020-01-04 16:21:41 +08:00
Qiu Jian
975154b98a minor fixes 2020-01-04 16:21:41 +08:00
Qiu Jian
1b23d6c755 add cloudevent capabilities 2020-01-04 16:21:41 +08:00
Qiu Jian
cdbc49a1a8 fix: add cloudprovider capabilities 2020-01-04 16:21:41 +08:00
wanyaoqi
86df323603 fix disk filter by guest 2020-01-04 15:19:16 +08:00
Zexi Li
422dcf8020 Merge pull request #4534 from zexi/automated-cherry-pick-of-#4533-upstream-release-3.0
Automated cherry pick of #4533: devtool: use public influxdb endpoint
2020-01-04 14:50:40 +08:00
Zexi Li
a47bdf3566 devtool: use public influxdb endpoint 2020-01-04 14:37:00 +08:00
yunion-ci-robot
275832f438 Merge pull request #4512 from tb365/automated-cherry-pick-of-#4509-upstream-release-3.0
Automated cherry pick of #4509: account create bugfix
2020-01-04 12:55:36 +08:00
TangBin
dbbe173e51 InitPendingUsagesInContext fix 2020-01-04 12:42:09 +08:00
TangBin
f0276d1a01 account&provider health status check 2020-01-04 12:42:09 +08:00
TangBin
0cfb8dbd5a elastic skus add region_ext_id & zone_ext_id 2020-01-04 12:42:09 +08:00
TangBin
ad0ddf6dd9 disk delete condition validator 2020-01-04 12:42:09 +08:00
TangBin
3b1c4dc2e5 huawei oss client read http ProxyFromEnvironment 2020-01-04 12:42:09 +08:00
TangBin
4d907584e2 network operations add action log 2020-01-04 12:42:09 +08:00
TangBin
2b9a995b13 account create bugfix 2020-01-04 12:42:09 +08:00
Zexi Li
6dc2ccee60 Merge pull request #4521 from zexi/automated-cherry-pick-of-#4520-upstream-release-3.0
Automated cherry pick of #4520: baremetal: fix megaraid check jbod always disabled
2020-01-03 21:51:22 +08:00
yunion-ci-robot
2bd77ec202 Merge pull request #4514 from ioito/automated-cherry-pick-of-#4513-upstream-release-3.0
Automated cherry pick of #4513: fix: 腾讯云不支持描述字段参数
2020-01-03 21:28:39 +08:00
Zexi Li
30fab89baa baremetal: fix megaraid check jbod always disabled 2020-01-03 21:21:33 +08:00
Qu Xuan
8d47608e4e fix: 腾讯云不支持描述字段参数 2020-01-03 20:41:28 +08:00
Zexi Li
eeeb81bf3f Merge pull request #4502 from swordqiu/automated-cherry-pick-of-#4498-upstream-release-3.0
Automated cherry pick of #4498: fix: allow delete cloudaccount with auto-sync enabled
2020-01-03 19:06:20 +08:00
yunion-ci-robot
78d68a023b Merge pull request #4505 from rainzm/automated-cherry-pick-of-#4497-upstream-release-3.0
Automated cherry pick of #4497: fix(huawei): Add 'X-Project-ID' header for huawei nat reuqest
2020-01-03 19:03:36 +08:00
yunion-ci-robot
6534a7c6a5 Merge pull request #4493 from ioito/automated-cherry-pick-of-#4492-upstream-release-3.0
Automated cherry pick of #4492: fix: 修复provider为空的套餐
2020-01-03 18:38:36 +08:00
Rain
9d60403817 fix(huawei): Add 'X-Project-ID' header for huawei nat reuqest 2020-01-03 17:23:52 +08:00
Qiu Jian
6ba7cbbb37 fix: allow delete cloudaccount with auto-sync enabled 2020-01-03 17:17:24 +08:00
Zexi Li
047bf47534 Merge pull request #4491 from swordqiu/automated-cherry-pick-of-#4488-upstream-release-3.0
Automated cherry pick of #4488: scheduler schedule according to quota limit
2020-01-03 17:13:42 +08:00
Qiu Jian
243590995f fix: OutOfQuota error code 500 2020-01-03 16:02:44 +08:00
Qiu Jian
53a9c010cb automatically save pendingUsage in context 2020-01-03 16:02:44 +08:00
Qiu Jian
9a6d9df76d remove obsolete codes 2020-01-03 16:02:44 +08:00
Qiu Jian
8870fe2d1f bug fixes 2020-01-03 16:02:43 +08:00
Qiu Jian
d2d8a7eeaa move lb from zonequota to regionquota 2020-01-03 16:02:43 +08:00
Qiu Jian
56be0bb3c5 scheduler schedule according to quota limit 2020-01-03 16:02:43 +08:00
Qu Xuan
d9956a9445 fix: 修复provider为空的套餐 2020-01-03 15:54:18 +08:00
Zexi Li
0702803b52 Merge pull request #4487 from rainzm/automated-cherry-pick-of-#4483-upstream-release-3.0
Automated cherry pick of #4483: fix(notify): Always update websocket config
2020-01-03 11:22:47 +08:00
Zexi Li
f12c77ca4c Merge pull request #4479 from swordqiu/automated-cherry-pick-of-#4478-upstream-release-3.0
Automated cherry pick of #4478: fix: bucket list object may skip first matched object
2020-01-03 11:01:21 +08:00
Rain
e0e72f4dc2 fix(notify): Always update websocket config 2020-01-02 19:15:23 +08:00
Qiu Jian
1cd4472073 fix: sort objects and directories 2020-01-02 17:47:07 +08:00
Qiu Jian
71c877428e fix: bucket list object may skip first matched object 2020-01-02 17:47:07 +08:00
rainzm
20a2dc5bf3 fix(region): Add support for suspend when syncing status of guest (#4477) 2020-01-02 16:34:22 +08:00
Zexi Li
e00f4a1f7d Merge pull request #4473 from zexi/automated-cherry-pick-of-#4411-upstream-release-3.0
Automated cherry pick of #4411: host misc fix
2020-01-02 12:32:16 +08:00
wanyaoqi
72c489140d host misc fix
- host check not require ntpd
- create host record use generate name
2020-01-02 12:32:32 +08:00
2324 changed files with 182653 additions and 288283 deletions

38
.circleci/Dockerfile Normal file
View File

@@ -0,0 +1,38 @@
FROM centos:7
MAINTAINER Yousong Zhou <zhouyousong@yunion.cn>
RUN true \
&& yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \
&& yum install -y git wget \
&& yum groupinstall -y "Development Tools" \
&& : ceph for cmd/host \
&& rpm --import 'https://download.ceph.com/keys/release.asc' \
&& yum install -y https://download.ceph.com/rpm-luminous/el7/noarch/ceph-release-1-1.el7.noarch.rpm \
&& yum install -y libcephfs-devel librbd-devel librados-devel \
&& yum clean all
WORKDIR /opt
RUN true \
&& wget https://dl.google.com/go/go1.13.3.linux-amd64.tar.gz \
&& tar xzf go1.13.3.linux-amd64.tar.gz \
&& rm -vf go1.13.3.linux-amd64.tar.gz \
&& true
ENV GOROOT="/opt/go"
ENV PATH="/opt/go/bin:${PATH}"
RUN useradd -c "OneCloud Builder" --create-home --home-dir /home/build --shell /bin/bash build
ENV HOME /home/build
WORKDIR /home/build
USER build
ENV GOPATH="/home/build/go"
ENV PATH="${GOPATH}/bin:${PATH}"
RUN true \
&& mkdir -p "$GOPATH" \
&& d="$GOPATH/src/golang.org/x/tools" \
&& mkdir -p "$d" \
&& git clone --branch yun --depth 8 https://github.com/yousong/tools "$d" \
&& cd "$d" \
&& go install ./cmd/goimports \
&& true

View File

@@ -5,10 +5,10 @@ version: 2
jobs:
check:
docker:
- image: yunionio/centos-build:1.0-1
- image: yunionio/onecloud-ci:v1.0.3
environment:
ONECLOUD_CI_BUILD: "1"
working_directory: /root/go/onecloud
working_directory: /home/build/go/src/yunion.io/x/onecloud
steps:
- checkout
- run:
@@ -18,7 +18,7 @@ jobs:
requires:
- check
docker:
- image: yunionio/centos-build:1.0-1
- image: yunionio/onecloud-ci:v1.0.2
environment:
ONECLOUD_CI_BUILD: "1"
@@ -26,14 +26,14 @@ jobs:
#### expecting it in the form of
#### /go/src/github.com/circleci/go-tool
#### /go/src/bitbucket.org/circleci/go-tool
working_directory: /root/go/onecloud
working_directory: /home/build/go/src/yunion.io/x/onecloud
parallelism: 4
steps:
- checkout
- restore_cache:
key: onecloud-build-cache-{{ checksum "go.mod" }}-{{ checksum "Makefile" }}
paths:
- /root/.cache/go-build
- /home/build/.cache/go-build
- run:
command: |
targets="$(circleci tests glob "cmd/*" | grep -v cmd/host-image | circleci tests split)"
@@ -43,7 +43,7 @@ jobs:
- save_cache:
key: onecloud-build-cache-{{ checksum "go.mod" }}-{{ checksum "Makefile" }}
paths:
- /root/.cache/go-build
- /home/build/.cache/go-build
- store_artifacts:
path: _output/
@@ -51,16 +51,16 @@ jobs:
requires:
- check
docker:
- image: yunionio/centos-build:1.0-1
- image: yunionio/onecloud-ci:v1.0.2
environment:
GO111MODULE: "on"
working_directory: /root/go/onecloud
working_directory: /home/build/go/src/yunion.io/x/onecloud
steps:
- checkout
- restore_cache:
key: onecloud-test-cache-{{ checksum "go.mod" }}-{{ checksum "Makefile" }}
paths:
- /root/.cache/go-build
- /home/build/.cache/go-build
- run:
name: unit_test
command: |
@@ -68,7 +68,7 @@ jobs:
- save_cache:
key: onecloud-test-cache-{{ checksum "go.mod" }}-{{ checksum "Makefile" }}
paths:
- /root/.cache/go-build
- /home/build/.cache/go-build
workflows:
version: 2

View File

@@ -29,17 +29,17 @@ jobs:
- name: Build
run: |
sudo apt-get update
sudo apt-get install librados-dev librbd-dev # baremetal-agent needs this
sudo apt-get install librados-dev librbd-dev
make cmd/apigateway cmd/climc cmd/keystone
make cmd/logger cmd/region cmd/scheduler cmd/webconsole
make cmd/yunionconf cmd/glance cmd/torrent cmd/s3gateway
make cmd/ansibleserver cmd/cloudnet cmd/notify
make cmd/host && ./scripts/bundle_libraries.sh _output/bin/bundles/host _output/bin/host && ./scripts/host_find_libraries.sh _output/bin/bundles/host
make cmd/host-deployer && ./scripts/bundle_libraries.sh _output/bin/bundles/host-deployer _output/bin/host-deployer
make cmd/baremetal-agent && ./scripts/bundle_libraries.sh _output/bin/bundles/baremetal-agent _output/bin/baremetal-agent
make cmd/cloudevent cmd/devtool
make cmd/*cli
make cmd/esxi-agent
make docker-alpine-build F='-j4 cmd/host cmd/vpcagent cmd/region-dns'
- name: Image baremetal-agent
uses: elgohr/Publish-Docker-Github-Action@master
@@ -61,16 +61,6 @@ jobs:
snapshot: true
dockerfile: build/docker/Dockerfile.esxi-agent
- name: Image vpcagent
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: registry.cn-beijing.aliyuncs.com/yunionio/vpcagent
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
registry: registry.cn-beijing.aliyuncs.com
snapshot: true
dockerfile: build/docker/Dockerfile.vpcagent
- name: Image climc
uses: elgohr/Publish-Docker-Github-Action@master
with:
@@ -220,13 +210,3 @@ jobs:
registry: registry.cn-beijing.aliyuncs.com
snapshot: true
dockerfile: build/docker/Dockerfile.devtool
- name: Image region DNS
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: registry.cn-beijing.aliyuncs.com/yunionio/region-dns
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
registry: registry.cn-beijing.aliyuncs.com
snapshot: true
dockerfile: build/docker/Dockerfile.region-dns

View File

@@ -192,77 +192,43 @@ mod:
go mod vendor -v
DOCKER_BUILD_IMAGE_VERSION?=1.0-1
DOCKER_BUILD_IMAGE_VERSION?=latest
define dockerCentOSBuildCmd
set -o xtrace
define dockerBuildCmd
set -o errexit
set -o pipefail
cd /root/onecloud
cd /home/build/onecloud
export GOFLAGS=-mod=vendor
make $(1)
chown -R $(shell id -u):$(shell id -g) _output
endef
docker-centos-build: export dockerCentOSBuildCmd:=$(call dockerCentOSBuildCmd,$(F))
docker-centos-build:
docker-build: export dockerBuildCmd:=$(call dockerBuildCmd,$(F))
docker-build:
echo "$$dockerBuildCmd"
docker rm --force onecloud-ci-build &>/dev/null || true
docker run \
--name onecloud-ci-build \
--rm \
--volume $(CURDIR):/root/onecloud \
--volume $(CURDIR)/_output/_cache:/root/.cache \
registry.cn-beijing.aliyuncs.com/yunionio/centos-build:$(DOCKER_BUILD_IMAGE_VERSION) \
/bin/bash -c "$$dockerCentOSBuildCmd"
--volume $(CURDIR):/home/build/onecloud \
yunionio/onecloud-ci:$(DOCKER_BUILD_IMAGE_VERSION) \
/bin/bash -c "$$dockerBuildCmd"
chown -R $$(id -u):$$(id -g) _output
ls -lh _output/bin
# NOTE we need a way to stop and remove the container started by docker-build.
# No --tty, --stop-signal won't work
docker-centos-build-stop:
docker-centos stop --time 0 onecloud-ci-build || true
docker-build-stop:
docker stop --time 0 onecloud-ci-build || true
.PHONY: docker-centos-build
.PHONY: docker-centos-build-stop
define dockerAlpineBuildCmd
set -o xtrace
set -o errexit
set -o pipefail
cd /root/go/src/yunion.io/x/onecloud
export GOFLAGS=-mod=vendor
make $(1)
chown -R $(shell id -u):$(shell id -g) _output
endef
docker-alpine-build: export dockerAlpineBuildCmd:=$(call dockerAlpineBuildCmd,$(F))
docker-alpine-build:
docker rm --force onecloud-docker-alpine-build &>/dev/null || true
docker run --rm \
--name onecloud-docker-alpine-build \
-v $(CURDIR):/root/go/src/yunion.io/x/onecloud \
-v $(CURDIR)/_output/alpine-build:/root/go/src/yunion.io/x/onecloud/_output \
-v $(CURDIR)/_output/alpine-build/_cache:/root/.cache \
registry.cn-beijing.aliyuncs.com/yunionio/alpine-build:1.0-1 \
/bin/sh -c "$$dockerAlpineBuildCmd"
ls -lh _output/alpine-build/bin
docker-alpine-build-stop:
docker stop --time 0 onecloud-docker-alpine-build || true
.PHONY: docker-alpine-build
.PHONY: docker-alpine-build-stop
.PHONY: docker-build
.PHONY: docker-build-stop
define helpText
Build with docker
make docker-centos-build F='-j4'
make docker-centos-build F='-j4 cmd/region cmd/climc'
make docker-centos-build-stop
make docker-alpine-build F='-j4'
make docker-alpine-build F='-j4 cmd/host cmd/host-deployer'
make docker-alpine-build-stop
make docker-build F='-j4'
make docker-build F='-j4 cmd/region cmd/climc'
make docker-build-stop
Tidy up go modules and vendor directory

View File

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

View File

@@ -32,8 +32,3 @@ COPY ./opt/cloud/yunion/baremetal/pxelinux.0 /opt/cloud/yunion/baremetal
ADD ./mkisofs /bin/mkisofs
ADD ./.mkisofs.bin /bin/.mkisofs.bin
ADD ./bundles/mkisofs /bin/bundles/mkisofs
# use GNU timeout command replace busybox timeout command
RUN rm /usr/bin/timeout
ADD ./timeout /bin/timeout
ADD ./.timeout.bin /bin/.timeout.bin
ADD ./bundles/timeout /bin/bundles/timeout

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,9 +1,11 @@
FROM registry.cn-beijing.aliyuncs.com/yunionio/host-base:v0.1.0
FROM registry.cn-beijing.aliyuncs.com/yunionio/host-base:v0.0.1
MAINTAINER "Yaoqi Wan wanyaoqi@yunionyun.com"
ENV TZ Asia/Shanghai
RUN apk add librados librbd
RUN mkdir -p /opt/yunion/bin
ADD ./_output/alpine-build/bin/host /opt/yunion/bin/host
ADD ./_output/bin/host /opt/yunion/bin/host
ADD ./_output/bin/.host.bin /opt/yunion/bin/.host.bin
ADD ./_output/bin/bundles/host /opt/yunion/bin/bundles/host

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,4 +1,3 @@
FROM alpine:3.11.3
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:latest
RUN mkdir -p /opt/yunion/bin
ADD ./_output/alpine-build/bin/region-dns /opt/yunion/bin/region-dns
ADD ./_output/bin/region-dns /opt/yunion/bin/region-dns

View File

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

View File

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

View File

@@ -1,6 +0,0 @@
FROM registry.cn-beijing.aliyuncs.com/yunionio/openvswitch:2.9.6-1
MAINTAINER "Yousong Zhou <zhouyousong@yunion.cn>"
RUN mkdir -p /opt/yunion/bin
ADD ./_output/alpine-build/bin/vpcagent /opt/yunion/bin/vpcagent

View File

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

View File

@@ -1,19 +0,0 @@
[Unit]
Description=Yunion Host Image Server
Documentation=https://docs.yunion.cn
After=network.target
[Service]
Type=simple
User=root
Group=root
ExecStart=/opt/yunion/bin/host-image --conf /etc/yunion/host.conf
WorkingDirectory=/opt/yunion/bin
KillMode=process
Restart=always
RestartSec=30
LimitNOFILE=500000
LimitNPROC=500000
[Install]
WantedBy=multi-user.target

View File

@@ -1,2 +0,0 @@
DESCRIPTION="Yunion Host Image Server"
SERVICE="yes"

View File

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

View File

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

View File

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

View File

@@ -35,7 +35,6 @@ import (
_ "yunion.io/x/onecloud/cmd/climc/shell/cloudnet"
_ "yunion.io/x/onecloud/cmd/climc/shell/etcd"
_ "yunion.io/x/onecloud/cmd/climc/shell/k8s"
_ "yunion.io/x/onecloud/cmd/climc/shell/monitor"
"yunion.io/x/onecloud/pkg/mcclient"
)

View File

@@ -26,33 +26,10 @@ import (
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func parseGcpCredential(filename string) (jsonutils.JSONObject, error) {
data, err := ioutil.ReadFile(filename)
if err != nil {
return nil, err
}
authParams, err := jsonutils.Parse(data)
if err != nil {
return nil, err
}
ret := jsonutils.NewDict()
for _, k := range []string{
"client_email",
"project_id",
"private_key_id",
"private_key",
} {
v, _ := authParams.Get(k)
ret.Add(v, fmt.Sprintf("gcp_%s", k))
}
return ret, nil
}
func init() {
type CloudaccountListOptions struct {
options.BaseListOptions
Capability []string `help:"capability filter" choices:"project|compute|network|loadbalancer|objectstore|rds|cache|event"`
}
R(&CloudaccountListOptions{}, "cloud-account-list", "List cloud accounts", func(s *mcclient.ClientSession, args *CloudaccountListOptions) error {
var params *jsonutils.JSONDict
@@ -62,9 +39,6 @@ func init() {
if err != nil {
return err
}
if len(args.Capability) > 0 {
params.Add(jsonutils.NewStringArray(args.Capability), "capability")
}
}
result, err := modules.Cloudaccounts.List(s, params)
if err != nil {
@@ -160,7 +134,11 @@ func init() {
R(&options.SGoogleCloudAccountCreateOptions{}, "cloud-account-create-google", "Create a Google cloud account", func(s *mcclient.ClientSession, args *options.SGoogleCloudAccountCreateOptions) error {
params := jsonutils.Marshal(args)
params.(*jsonutils.JSONDict).Add(jsonutils.NewString("Google"), "provider")
authParams, err := parseGcpCredential(args.GoogleJsonFile)
data, err := ioutil.ReadFile(args.GoogleJsonFile)
if err != nil {
return err
}
authParams, err := jsonutils.Parse(data)
if err != nil {
return err
}
@@ -399,19 +377,6 @@ func init() {
return nil
})
R(&options.SGoogleCloudAccountUpdateOptions{}, "cloud-account-update-google", "update a google cloud account", func(s *mcclient.ClientSession, args *options.SGoogleCloudAccountUpdateOptions) error {
params := jsonutils.Marshal(args).(*jsonutils.JSONDict)
if params.Size() == 0 {
return InvalidUpdateError()
}
result, err := modules.Cloudaccounts.Update(s, args.ID, params)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&options.SAWSCloudAccountUpdateOptions{}, "cloud-account-update-aws", "update an AWS cloud account", func(s *mcclient.ClientSession, args *options.SAWSCloudAccountUpdateOptions) error {
params := jsonutils.Marshal(args).(*jsonutils.JSONDict)
@@ -453,7 +418,7 @@ func init() {
return nil
})
R(&options.SOpenStackCloudAccountUpdateOptions{}, "cloud-account-update-openstack", "update an OpenStack cloud account", func(s *mcclient.ClientSession, args *options.SOpenStackCloudAccountUpdateOptions) error {
R(&options.SOpenStackCloudAccountUpdateOptions{}, "cloud-account-update-openstack", "update an AWS cloud account", func(s *mcclient.ClientSession, args *options.SOpenStackCloudAccountUpdateOptions) error {
params := jsonutils.Marshal(args).(*jsonutils.JSONDict)
if params.Size() == 0 {
return InvalidUpdateError()
@@ -705,19 +670,6 @@ func init() {
return nil
})
R(&options.SGoogleCloudAccountUpdateCredentialOptions{}, "cloud-account-update-credential-google", "Update credential of a Google cloud account", func(s *mcclient.ClientSession, args *options.SGoogleCloudAccountUpdateCredentialOptions) error {
params, err := parseGcpCredential(args.GoogleJsonFile)
if err != nil {
return err
}
result, err := modules.Cloudaccounts.PerformAction(s, args.ID, "update-credential", params)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&options.SS3CloudAccountUpdateCredentialOptions{}, "cloud-account-update-credential-s3", "Update credential of a generic S3 cloud account", func(s *mcclient.ClientSession, args *options.SS3CloudAccountUpdateCredentialOptions) error {
params := jsonutils.Marshal(args)
result, err := modules.Cloudaccounts.PerformAction(s, args.ID, "update-credential", params)

View File

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

View File

@@ -31,9 +31,8 @@ func init() {
Usable bool `help:"Vpc & Network usable"`
HasObjectStorage bool `help:"filter cloudproviders that has object storage"`
NoObjectStorage bool `help:"filter cloudproviders that has no object storage"`
Capability []string `help:"capability filter" choices:"project|compute|network|loadbalancer|objectstore|rds|cache|event"`
HasObjectStorage bool `help:"filter cloudproviders that has object storage"`
NoObjectStorage bool `help:"filter cloudproviders that has no object storage"`
}
R(&CloudproviderListOptions{}, "cloud-provider-list", "List cloud providers", func(s *mcclient.ClientSession, args *CloudproviderListOptions) error {
var params *jsonutils.JSONDict
@@ -53,10 +52,6 @@ func init() {
} else if args.NoObjectStorage {
params.Add(jsonutils.JSONFalse, "has_object_storage")
}
if len(args.Capability) > 0 {
params.Add(jsonutils.NewStringArray(args.Capability), "capability")
}
}
result, err := modules.Cloudproviders.List(s, params)
if err != nil {

View File

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

View File

@@ -18,13 +18,11 @@ import (
"fmt"
"yunion.io/x/jsonutils"
"yunion.io/x/log"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
"yunion.io/x/onecloud/pkg/util/fileutils2"
"yunion.io/x/onecloud/pkg/util/ssh"
)
func init() {
@@ -666,44 +664,4 @@ func init() {
printObject(result)
return nil
})
type HostSSHLoginOptions struct {
ID string `help:"ID or name of host"`
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)
if e != nil {
return e
}
host, err := i.GetString("ip")
if err != nil {
return err
}
user, err := i.GetString("username")
if err != nil {
return err
}
passwd, err := i.GetString("password")
if err != nil {
return err
}
port := 22
if args.Port != 22 {
port = args.Port
}
sshCli, err := ssh.NewClient(host, port, user, passwd, "")
if err != nil {
return err
}
log.Infof("ssh %s:%d", host, port)
if err := sshCli.RunTerminal(); err != nil {
return err
}
return nil
})
}

View File

@@ -50,7 +50,7 @@ type ImageOptionalOptions struct {
OsLang string `help:"OS Language" choices:"zh_CN|en_US"`
Preference int64 `help:"Disk preferences"`
Notes string `help:"Notes about the image"`
Hypervisor []string `help:"Prefer hypervisor type" choices:"kvm|esxi|baremetal|container|openstack|ctyun"`
Hypervisor []string `help:"Prefer hypervisor type" choices:"kvm|esxi|baremetal|container|openstack"`
DiskDriver string `help:"Perfer disk driver" choices:"virtio|scsi|pvscsi|ide|sata"`
NetDriver string `help:"Preferred network driver" choices:"virtio|e1000|vmxnet3"`
}

View File

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

View File

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

View File

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

View File

@@ -51,10 +51,9 @@ func init() {
})
type KeypairCreate struct {
NAME string `help:"Name of keypair to be created"`
Scheme string `help:"Scheme of keypair, default is RSA" choices:"RSA" default:"RSA"`
PublicKey string `help:"Publickey of keypair"`
Desc string `help:"Short description of keypair"`
NAME string `help:"Name of keypair to be created"`
Scheme string `help:"Scheme of keypair, default is RSA" choices:"RSA|DSA" default:"RSA"`
Desc string `help:"Short description of keypair"`
}
R(&KeypairCreate{}, "keypair-create", "Create a new keypair", func(s *mcclient.ClientSession, args *KeypairCreate) error {
@@ -64,10 +63,6 @@ func init() {
params.Add(jsonutils.NewString(args.Scheme), "scheme")
}
if len(args.PublicKey) > 0 {
params.Add(jsonutils.NewString(args.PublicKey), "public_key")
}
if len(args.Desc) > 0 {
params.Add(jsonutils.NewString(args.Desc), "description")
}

View File

@@ -1,116 +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 monitor
import (
"fmt"
monitorapi "yunion.io/x/onecloud/pkg/apis/monitor"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules/monitor"
options "yunion.io/x/onecloud/pkg/mcclient/options/monitor"
)
func init() {
aN := cmdN("alert")
R(&options.AlertListOptions{}, aN("list"), "List all alerts",
func(s *mcclient.ClientSession, args *options.AlertListOptions) error {
params, err := args.Params()
if err != nil {
return err
}
ret, err := monitor.Alerts.List(s, params)
if err != nil {
return err
}
printList(ret, monitor.Alerts.GetColumns(s))
return nil
})
R(&options.AlertCreateOptions{}, aN("create"), "Create alert rule",
func(s *mcclient.ClientSession, args *options.AlertCreateOptions) error {
params, err := args.Params()
if err != nil {
return err
}
ret, err := monitor.Alerts.DoCreate(s, params)
if err != nil {
return err
}
printObject(ret)
return nil
})
R(&options.AlertShowOptions{}, aN("show"), "Show details of a alert rule",
func(s *mcclient.ClientSession, args *options.AlertShowOptions) error {
ret, err := monitor.Alerts.Get(s, args.ID, nil)
if err != nil {
return err
}
printObject(ret)
return nil
})
R(&options.AlertUpdateOptions{}, aN("update"), "Update a alert rule",
func(s *mcclient.ClientSession, args *options.AlertUpdateOptions) error {
params, err := args.Params()
if err != nil {
return err
}
ret, err := monitor.Alerts.Update(s, args.ID, params.JSON(params))
if err != nil {
return err
}
printObject(ret)
return nil
})
R(&options.AlertDeleteOptions{}, aN("delete"), "Delete alerts",
func(s *mcclient.ClientSession, args *options.AlertDeleteOptions) error {
ret := monitor.Alerts.BatchDelete(s, args.ID, nil)
printBatchResults(ret, monitor.Alerts.GetColumns(s))
return nil
})
R(&options.AlertTestRunOptions{}, aN("test-run"), "Test run alert",
func(s *mcclient.ClientSession, args *options.AlertTestRunOptions) error {
data := new(monitorapi.AlertTestRunInput)
if args.Debug {
data.IsDebug = true
}
ret, err := monitor.Alerts.DoTestRun(s, args.ID, data)
if err != nil {
return err
}
fmt.Println(ret.JSON(ret).YAMLString())
return nil
})
R(&options.AlertPauseOptions{}, aN("pause"), "Pause or unpause alert",
func(s *mcclient.ClientSession, args *options.AlertPauseOptions) error {
data := new(monitorapi.AlertPauseInput)
if args.UnPause {
data.Paused = false
} else {
data.Paused = true
}
ret, err := monitor.Alerts.PerformAction(s, args.ID, "pause", data.JSON(data))
if err != nil {
return err
}
printObject(ret)
return nil
})
}

View File

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

View File

@@ -1,27 +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 monitor
import (
"yunion.io/x/onecloud/cmd/climc/shell"
"yunion.io/x/onecloud/pkg/util/printutils"
)
var (
R = shell.R
printList = printutils.PrintJSONList
printObject = printutils.PrintJSONObject
printBatchResults = printutils.PrintJSONBatchResults
)

View File

@@ -1,56 +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 monitor
import (
"fmt"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules/monitor"
options "yunion.io/x/onecloud/pkg/mcclient/options/monitor"
)
func cmdN(suffix string) func(action string) string {
return func(action string) string {
return fmt.Sprintf("monitor-%s-%s", suffix, action)
}
}
func init() {
dsN := cmdN("datasource")
R(&options.DataSourceListOptions{}, dsN("list"), "List all monitor data source",
func(s *mcclient.ClientSession, args *options.DataSourceListOptions) error {
params, err := args.Params()
if err != nil {
return err
}
ret, err := monitor.DataSources.List(s, params)
if err != nil {
return err
}
printList(ret, monitor.DataSources.GetColumns(s))
return nil
})
R(&options.DataSourceDeleteOptions{}, dsN("delete"), "Delete monitor data source",
func(s *mcclient.ClientSession, args *options.DataSourceDeleteOptions) error {
ret, err := monitor.DataSources.Delete(s, args.ID, nil)
if err != nil {
return err
}
printObject(ret)
return nil
})
}

View File

@@ -1,99 +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 monitor
import (
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules/monitor"
options "yunion.io/x/onecloud/pkg/mcclient/options/monitor"
)
func init() {
nN := cmdN("notification")
R(&options.NotificationListOptions{}, nN("list"), "List all alert notification",
func(s *mcclient.ClientSession, args *options.NotificationListOptions) error {
params, err := args.Params()
if err != nil {
return err
}
ret, err := monitor.Notifications.List(s, params)
if err != nil {
return err
}
printList(ret, monitor.Notifications.GetColumns(s))
return nil
})
R(&options.NotificationDingDingCreateOptions{}, nN("create-dingding"),
"Create dingding alert notification",
func(s *mcclient.ClientSession, args *options.NotificationDingDingCreateOptions) error {
params, err := args.Params()
if err != nil {
return err
}
ret, err := monitor.Notifications.Create(s, params.JSON(params))
if err != nil {
return err
}
printObject(ret)
return nil
})
R(&options.NotificationFeishuCreateOptions{}, nN("create-feishu"),
"Create feishu alert notification",
func(s *mcclient.ClientSession, args *options.NotificationFeishuCreateOptions) error {
params, err := args.Params()
if err != nil {
return err
}
ret, err := monitor.Notifications.Create(s, params.JSON(params))
if err != nil {
return err
}
printObject(ret)
return nil
})
R(&options.NotificationShowOptions{}, nN("show"), "Show alert notification",
func(s *mcclient.ClientSession, args *options.NotificationShowOptions) error {
ret, err := monitor.Notifications.Get(s, args.ID, nil)
if err != nil {
return err
}
printObject(ret)
return nil
})
R(&options.NotificationUpdateOptions{}, nN("update"), "Update alert notification",
func(s *mcclient.ClientSession, args *options.NotificationUpdateOptions) error {
params, err := args.Params()
if err != nil {
return err
}
ret, err := monitor.Notifications.Update(s, args.ID, params.JSON(params))
if err != nil {
return err
}
printObject(ret)
return nil
})
R(&options.NotificationDeleteOptions{}, nN("delete"), "Show delete notification",
func(s *mcclient.ClientSession, args *options.NotificationDeleteOptions) error {
ret := monitor.Notifications.BatchDelete(s, args.ID, nil)
printBatchResults(ret, monitor.Notifications.GetColumns(s))
return nil
})
}

View File

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

View File

@@ -59,18 +59,18 @@ func init() {
* 修改指定的报警规则
*/
type NodealertUpdateOptions struct {
ID string `help:"ID of the alert rule" required:"true" positional:"true"`
Type string `help:"Alert rule type" choices:"guest|host"`
Metric string `help:"Metric name, include measurement and field, such as vm_cpu.usage_active"`
NodeName string `help:"Name of the guest or host"`
NodeID string `help:"ID of the guest or host"`
Period string `help:"Specify the query time period for the data"`
Window string `help:"Specify the query interval for the data"`
Threshold *float64 `help:"Threshold value of the metric"`
Comparator string `help:"Comparison operator for join expressions" choices:">|<|>=|<=|=|!="`
Recipients string `help:"Comma separated recipient ID"`
Level string `help:"Alert level" choices:"normal|important|fatal"`
Channel string `help:"Ways to send an alarm" choices:"email|mobile"`
ID string `help:"ID of the alert rule" required:"true" positional:"true"`
Type string `help:"Alert rule type" choices:"guest|host"`
Metric string `help:"Metric name, include measurement and field, such as vm_cpu.usage_active"`
NodeName string `help:"Name of the guest or host"`
NodeID string `help:"ID of the guest or host"`
Period string `help:"Specify the query time period for the data"`
Window string `help:"Specify the query interval for the data"`
Threshold float64 `help:"Threshold value of the metric"`
Comparator string `help:"Comparison operator for join expressions" choices:">|<|>=|<=|=|!="`
Recipients string `help:"Comma separated recipient ID"`
Level string `help:"Alert level" choices:"normal|important|fatal"`
Channel string `help:"Ways to send an alarm" choices:"email|mobile"`
}
R(&NodealertUpdateOptions{}, "nodealert-update", "Update the node alert rule", func(s *mcclient.ClientSession, args *NodealertUpdateOptions) error {
params, err := options.StructToParams(args)
@@ -92,11 +92,14 @@ func init() {
* 删除指定ID的报警规则
*/
type NodealertDeleteOptions struct {
ID []string `help:"ID of node alert" required:"true" positional:"true"`
ID string `help:"ID of node alert" required:"true" positional:"true"`
}
R(&NodealertDeleteOptions{}, "nodealert-delete", "Delete a node alert", func(s *mcclient.ClientSession, args *NodealertDeleteOptions) error {
ret := modules.NodeAlert.BatchDelete(s, args.ID, nil)
printBatchResults(ret, modules.NodeAlert.GetColumns(s))
alarm, err := modules.NodeAlert.Delete(s, args.ID, nil)
if err != nil {
return err
}
printObject(alarm)
return nil
})

View File

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

View File

@@ -1,81 +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 shell
import (
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func init() {
R(&options.ProxySettingCreateOptions{}, "proxysetting-create", "Create proxysetting", func(s *mcclient.ClientSession, opts *options.ProxySettingCreateOptions) error {
params, err := options.StructToParams(opts)
if err != nil {
return err
}
proxysetting, err := modules.ProxySettings.Create(s, params)
if err != nil {
return err
}
printObject(proxysetting)
return nil
})
R(&options.ProxySettingGetOptions{}, "proxysetting-show", "Show proxysetting", func(s *mcclient.ClientSession, opts *options.ProxySettingGetOptions) error {
proxysetting, err := modules.ProxySettings.Get(s, opts.ID, nil)
if err != nil {
return err
}
printObject(proxysetting)
return nil
})
R(&options.ProxySettingListOptions{}, "proxysetting-list", "List proxysettings", func(s *mcclient.ClientSession, opts *options.ProxySettingListOptions) error {
params, err := options.ListStructToParams(opts)
if err != nil {
return err
}
result, err := modules.ProxySettings.List(s, params)
if err != nil {
return err
}
printList(result, modules.ProxySettings.GetColumns(s))
return nil
})
R(&options.ProxySettingUpdateOptions{}, "proxysetting-update", "Update proxysetting", func(s *mcclient.ClientSession, opts *options.ProxySettingUpdateOptions) error {
params, err := options.StructToParams(opts)
proxysetting, err := modules.ProxySettings.Update(s, opts.ID, params)
if err != nil {
return err
}
printObject(proxysetting)
return nil
})
R(&options.ProxySettingDeleteOptions{}, "proxysetting-delete", "Delete proxysetting", func(s *mcclient.ClientSession, opts *options.ProxySettingDeleteOptions) error {
proxysetting, err := modules.ProxySettings.Delete(s, opts.ID, nil)
if err != nil {
return err
}
printObject(proxysetting)
return nil
})
R(&options.ProxySettingTestOptions{}, "proxysetting-test", "Test proxysetting", func(s *mcclient.ClientSession, opts *options.ProxySettingTestOptions) error {
proxysetting, err := modules.ProxySettings.PerformAction(s, opts.ID, "test", nil)
if err != nil {
return err
}
printObject(proxysetting)
return nil
})
}

View File

@@ -21,7 +21,6 @@ import (
"yunion.io/x/jsonutils"
"yunion.io/x/pkg/util/regutils"
"yunion.io/x/onecloud/pkg/apis/compute"
"yunion.io/x/onecloud/pkg/cloudcommon/cmdline"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modulebase"
@@ -151,19 +150,12 @@ func init() {
})
type ServerAttachNetworkOptions struct {
SERVER string `help:"ID or Name of server"`
NETDESC []string `help:"Network description"`
SERVER string `help:"ID or Name of server"`
NETDESC string `help:"Network description"`
}
R(&ServerAttachNetworkOptions{}, "server-attach-network", "Attach a server to a virtual network", func(s *mcclient.ClientSession, args *ServerAttachNetworkOptions) error {
input := compute.AttachNetworkInput{[]*compute.NetworkConfig{}}
for i := 0; i < len(args.NETDESC); i++ {
conf, err := cmdline.ParseNetworkConfig(args.NETDESC[i], -1)
if err != nil {
return err
}
input.Nets = append(input.Nets, conf)
}
params := jsonutils.Marshal(input)
params := jsonutils.NewDict()
params.Add(jsonutils.NewString(args.NETDESC), "net_desc")
srv, err := modules.Servers.PerformAction(s, args.SERVER, "attachnetwork", params)
if err != nil {
return err

View File

@@ -34,7 +34,6 @@ import (
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
"yunion.io/x/onecloud/pkg/util/fileutils2"
"yunion.io/x/onecloud/pkg/util/ssh"
)
func init() {
@@ -988,7 +987,6 @@ func init() {
config.Hosts[i].HostIp = yamlConfig.Hosts[i].HostIp
config.Hosts[i].XmlFilePath = yamlConfig.Hosts[i].XmlFilePath
config.Hosts[i].Servers = make([]compute.SLibvirtServerConfig, len(yamlConfig.Hosts[i].Servers))
config.Hosts[i].MonitorPath = yamlConfig.Hosts[i].MonitorPath
for j := 0; j < len(yamlConfig.Hosts[i].Servers); j++ {
config.Hosts[i].Servers[j].MacIp = make(map[string]string)
mac := yamlConfig.Hosts[i].Servers[j].Mac
@@ -1011,11 +1009,11 @@ func init() {
if err != nil {
return err
}
//for i := 0; i < len(params); i++ {
// val := jsonutils.NewDict()
// val.Set(modules.Servers.KeywordPlural, params[i])
// params[i] = val
//}
for i := 0; i < len(params); i++ {
val := jsonutils.NewDict()
val.Set(modules.Servers.KeywordPlural, params[i])
params[i] = val
}
results := modules.Servers.BatchPerformClassAction(s, "import-from-libvirt", params)
printBatchResults(results, modules.Servers.GetColumns(s))
@@ -1233,77 +1231,4 @@ func init() {
}
return nil
})
R(&options.ServerSSHLoginOptions{}, "server-ssh", "Use SSH login a server", func(s *mcclient.ClientSession, opts *options.ServerSSHLoginOptions) error {
srv, err := modules.Servers.Get(s, opts.ID, nil)
if err != nil {
return err
}
srvid, err := srv.GetString("id")
if err != nil {
return err
}
address := make([]string, 0)
nics, err := srv.GetArray("nics")
if err != nil {
return err
}
for _, nic := range nics {
if addr, err := nic.GetString("ip_addr"); err == nil {
address = append(address, addr)
}
}
if len(address) == 0 {
return fmt.Errorf("Not found ip address from server %s", opts.ID)
}
params := jsonutils.NewDict()
if len(opts.Key) > 0 {
privateKey, e := ioutil.ReadFile(opts.Key)
if e != nil {
return e
}
params.Add(jsonutils.NewString(string(privateKey)), "private_key")
}
i, e := modules.Servers.GetLoginInfo(s, srvid, params)
if e != nil {
return e
}
passwd, err := i.GetString("password")
if err != nil {
return err
}
if opts.Password != "" {
passwd = opts.Password
}
user, err := i.GetString("username")
if err != nil {
return err
}
if opts.User != "" {
user = opts.User
}
host := address[0]
if opts.Host != "" {
host = opts.Host
}
port := 22
if opts.Port != 22 {
port = opts.Port
}
sshCli, err := ssh.NewClient(host, port, user, passwd, "")
if err != nil {
return err
}
log.Infof("ssh %s:%d", host, port)
if err := sshCli.RunTerminal(); err != nil {
return err
}
return nil
})
}

View File

@@ -15,7 +15,6 @@
package shell
import (
"encoding/base64"
"fmt"
"net/url"
@@ -46,9 +45,6 @@ func init() {
if err != nil {
return err
}
if decodeStr, err := base64.StdEncoding.DecodeString(connParams); err == nil {
connParams = string(decodeStr)
}
var query url.Values
connUrl, err := url.ParseRequestURI(connParams)
if err == nil {
@@ -68,9 +64,7 @@ func init() {
return nil
}
newQuery := url.Values(make(map[string][]string))
newQuery.Set("data", base64.StdEncoding.EncodeToString([]byte(connParams)))
u.RawQuery = newQuery.Encode()
u.RawQuery = connParams
fmt.Println(u.String())
return nil
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,71 +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 main
import (
"context"
"os"
"os/signal"
"sync"
"syscall"
"yunion.io/x/log"
app_common "yunion.io/x/onecloud/pkg/cloudcommon/app"
common_options "yunion.io/x/onecloud/pkg/cloudcommon/options"
"yunion.io/x/onecloud/pkg/util/atexit"
"yunion.io/x/onecloud/pkg/vpcagent/options"
_ "yunion.io/x/onecloud/pkg/vpcagent/ovn"
"yunion.io/x/onecloud/pkg/vpcagent/worker"
)
func main() {
defer atexit.Handle()
opts := &options.Options{}
commonOpts := &opts.CommonOptions
{
common_options.ParseOptions(opts, os.Args, "vpcagent.conf", "vpcagent")
app_common.InitAuth(commonOpts, func() {
log.Infof("auth finished ok")
})
}
if err := opts.ValidateThenInit(); err != nil {
log.Fatalf("opts validate: %s", err)
}
w := worker.NewWorker(opts)
if w == nil {
log.Fatalf("new worker failed")
}
{
wg := &sync.WaitGroup{}
ctx, cancelFunc := context.WithCancel(context.Background())
ctx = context.WithValue(ctx, "wg", wg)
wg.Add(1)
go w.Start(ctx)
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

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

90
go.mod
View File

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

507
go.sum

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

@@ -28,7 +28,6 @@ import (
"yunion.io/x/jsonutils"
"yunion.io/x/log"
"yunion.io/x/pkg/utils"
"yunion.io/x/onecloud/pkg/apigateway/options"
"yunion.io/x/onecloud/pkg/appctx"
@@ -38,7 +37,6 @@ import (
"yunion.io/x/onecloud/pkg/mcclient/auth"
"yunion.io/x/onecloud/pkg/mcclient/modulebase"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/util/httputils"
)
const (
@@ -173,23 +171,19 @@ func (mh *MiscHandler) DoBatchHostRegister(ctx context.Context, w http.ResponseW
}
paramKeys := []string{}
i1 := -1
i2 := -1
for i, title := range rows[0] {
for _, title := range rows[0] {
switch title {
case HOST_MAC:
paramKeys = append(paramKeys, "access_mac")
case HOST_NAME:
paramKeys = append(paramKeys, "name")
case HOST_IPMI_ADDR, HOST_IPMI_ADDR_OPTIONAL:
i1 = i
paramKeys = append(paramKeys, "ipmi_ip_addr")
case HOST_IPMI_USERNAME, HOST_IPMI_USERNAME_OPTIONAL:
paramKeys = append(paramKeys, "ipmi_username")
case HOST_IPMI_PASSWORD, HOST_IPMI_PASSWORD_OPTIONAL:
paramKeys = append(paramKeys, "ipmi_password")
case HOST_MNG_IP_ADDR, HOST_MNG_IP_ADDR_OPTIONAL:
i2 = i
paramKeys = append(paramKeys, "access_ip")
default:
e := httperrors.NewInternalServerError("empty file content")
@@ -205,33 +199,8 @@ func (mh *MiscHandler) DoBatchHostRegister(ctx context.Context, w http.ResponseW
return
}
ips := []string{}
hosts := bytes.Buffer{}
for _, row := range rows[1:] {
var e *httputils.JSONClientError
if i1 >= 0 && len(row[i1]) > 0 {
i1Ip := fmt.Sprintf("%d-%s", i1, row[i1])
if utils.IsInStringArray(i1Ip, ips) {
e = httperrors.NewDuplicateIdError("ip", row[i1])
} else {
ips = append(ips, i1Ip)
}
}
if i2 >= 0 && len(row[i2]) > 0 {
i2Ip := fmt.Sprintf("%d-%s", i2, row[i2])
if utils.IsInStringArray(i2Ip, ips) {
e = httperrors.NewDuplicateIdError("ip", row[i2])
} else {
ips = append(ips, i2Ip)
}
}
if e != nil {
httperrors.JsonClientError(w, e)
return
}
hosts.WriteString(strings.Join(row, ",") + "\n")
}

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,27 +0,0 @@
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by model-api-gen. DO NOT EDIT.
package proxy
import (
"yunion.io/x/onecloud/pkg/apis"
)
// SProxySetting is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudcommon/db/proxy.SProxySetting.
type SProxySetting struct {
apis.SStandaloneResourceBase
HTTPProxy string `json:"http_proxy"`
HTTPSProxy string `json:"https_proxy"`
NoProxy string `json:"no_proxy"`
}

View File

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

View File

@@ -16,16 +16,8 @@ package cloudprovider
// SGeographicInfo is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudprovider.SGeographicInfo.
type SGeographicInfo struct {
// 纬度
// example: 26.647003
Latitude float32 `json:"latitude"`
// 经度
// example: 106.630211
Longitude float32 `json:"longitude"`
// 城市
// example: Guiyang
City string `json:"city"`
// 国家代码
// example: CN
CountryCode string `json:"country_code"`
Latitude float32 `json:"latitude"`
Longitude float32 `json:"longitude"`
City string `json:"city"`
CountryCode string `json:"country_code"`
}

View File

@@ -31,36 +31,14 @@ type SchedtagConfig struct {
type NetworkConfig struct {
apis.Meta
// 网卡序号, 从0开始
// required: true
Index int `json:"index"`
// 子网名称或ID
// required: true
Network string `json:"network"`
// swagger:ignore
Wire string `json:"wire"`
// 内网地址
Exit bool `json:"exit"`
Private bool `json:"private"`
// 网卡MAC地址
// requried: false
Mac string `json:"mac"`
// 子网内的IPv4地址, 若不指定会安装子网的地址分配策略分配一个IP地址
// required: false
Address string `json:"address"`
// 子网内的IPv6地址
// required: false
// swagger:ignore
Index int `json:"index"`
Network string `json:"network"`
Wire string `json:"wire"`
Exit bool `json:"exit"`
Private bool `json:"private"`
Mac string `json:"mac"`
Address string `json:"address"`
Address6 string `json:"address6"`
// 驱动方式
// 若指定镜像的网络驱动方式,此参数会被覆盖
Driver string `json:"driver"`
BwLimit int `json:"bw_limit"`
Vip bool `json:"vip"`
@@ -75,132 +53,33 @@ type NetworkConfig struct {
StandbyPortCount int `json:"standby_port_count"`
StandbyAddrCount int `json:"standby_addr_count"`
// swagger:ignore
Project string `json:"project_id"`
// swagger:ignore
Project string `json:"project_id"`
Domain string `json:"domain_id"`
Ifname string `json:"ifname"`
Schedtags []*SchedtagConfig `json:"schedtags"`
}
type AttachNetworkInput struct {
// 添加的网卡的配置
// required: true
Nets []*NetworkConfig `json:"nets"`
}
type DiskConfig struct {
apis.Meta
// 挂载到虚拟机的磁盘顺序, -1代表不挂载任何虚拟机
// default: -1
Index int `json:"index"`
Index int `json:"index"` // -1 means not attach to any guests
ImageId string `json:"image_id"`
SnapshotId string `json:"snapshot_id"`
DiskType string `json:"disk_type"`
Schedtags []*SchedtagConfig `json:"schedtags"`
// 镜像ID,通过镜像创建磁盘,创建虚拟机时第一块磁盘需要指定此参数
// required: false
ImageId string `json:"image_id"`
// 快照ID,通过快照创建磁盘,此参数必须加上 'snapshot-' 前缀
// example: snapshot-3140cecb-ccc4-4865-abae-3a5ba8c69d9b
// requried: false
SnapshotId string `json:"snapshot_id"`
// 磁盘类型
// enum: sys, data, swap
DiskType string `json:"disk_type"`
Schedtags []*SchedtagConfig `json:"schedtags"`
// 磁盘大小,单位Mb
// 若创建裸金属服务器是, -1代表自动向后扩展存储
// requried:true
SizeMb int `json:"size"`
// 文件系统,仅kvm支持自动格式化磁盘,私有云和公有云此参数不会生效
// enum: swap, ext2, ext3, ext4, xfs, ntfs, fat, hfsplus
// requried: false
Fs string `json:"fs"`
// 磁盘存储格式
// enum: qcow2, raw, docker, iso, vmdk, vmdkflatver1, vmdkflatver2, vmdkflat, vmdksparse, vmdksparsever1, vmdksparsever2, vmdksepsparse vhd
// requried: false
Format string `json:"format"`
// 磁盘驱动方式
// enum: virtio, ide, scsi, sata, pvscsi
// requried: false
Driver string `json:"driver"`
// 磁盘缓存模式
// enum: writeback, none, writethrough
// requried: false
Cache string `json:"cache"`
// 挂载点,必须以 '/' 开头,例如 /opt 仅KVM此参数有效
// requried: false
Mountpoint string `json:"mountpoint"`
//后端存储类型,若指定了存储ID,此参数会根据存储设置,若不指定,则作为调度的一个参考
//
//
//
//| 平台 | 存储类型 | 中文 | 数据盘 | 系统盘 | 可否扩容 | 可否单独创建 | 扩容步长 | 说明 |
//| ---- | ---- | ---- | ----- | ----- | ------- | ----------- | ------- | ----- |
//| Esxi |local |本地盘 |1-500GB |30~500GB | 是 | 否 | 1G | |
//| Esxi |nas |NAS盘 |30-3072GB |30~500GB | 是 | 否 | 1G | |
//| Esxi |vsan |VSAN盘 |30-3072GB |30~500GB | 是 | 否 | 1G | |
//| KVM |local |本地盘盘 |1-500GB |30~500GB | 是 | 否 | 1G | |
//| KVM |rbd |云硬盘 |1-3072GB |30~500GB | 是 | 是 | 1G | |
//| Azure |standard_lrs |标准 HDD |1-4095GB |30~4095GB | 是 | 是 | 1G | |
//| Azure |standardssd_lrs |标准 SSD |1-4095GB |30~4095GB | 是 | 是 | 1G | |
//| Azure |premium_lrs |高级SSD |1-4095GB |30~4095GB | 是 | 是 | 1G | |
//| AWS |gp2 |通用型SSD |1-16384GB |20~16384GB | 是 | 是 | 1G | |
//| AWS |io1 |预配置 IOPS SSD|4-16384GB |20-16384GB | 是 | 是 | 1G | |
//| AWS |st1 |吞吐优化HDD |500-16384GB |不支持 | 是 | 是 | 1G | |
//| AWS |sc1 |Cold HDD |500-16384GB |不支持 | 是 | 是 | 1G | |
//| AWS |standard |磁介质 |1-1024GB |20-1024GB | 是 | 是 | 1G | |
//| 腾讯云 |cloud_ssd |SSD云硬盘 |10-16000GB |50~500GB | 是 | 是 | 10G | |
//| 腾讯云 |cloud_basic |普通云硬盘 |10-16000GB |50~500GB | 是 | 是 | 10G | |
//| 腾讯云 |cloud_preium |高性能云硬盘 |10-16000GB |50~1024GB | 是 | 是 | 10G | |
//| 腾讯云 |local_basic |普通本地盘 |10-1600GB |不支持 | 否 | 否 | | |
//| 腾讯云 |local_ssd |SSD本地盘 |10-7000GB |部分区域套餐支持 | 否 | 否 | | |
//| 腾讯云 |local_pro |HDD本地盘 |跟随套餐 |部分区域套餐支持 | 否 | 否 | | |
//| 华为云或天翼云 |SSD |超高IO云硬盘 |10-32768GB |40~1024GB | 是 | 是 | 1G | |
//| 华为云或天翼云 |SAS |高IO云硬盘 |10-32768GB |40~1024GB | 是 | 是 | 1G | |
//| 华为云或天翼云 |SATA |普通IO云硬盘 |10-32768GB |40~1024GB | 是 | 是 | 1G | |
//| OpenStack |nova |nova |不支持 |30-500GB | 否 | 否 | | |
//| OpenStack |自定义 |... |无限制 |无限制 | 是 | 是 | 1G | |
//| Ucloud |CLOUD_NORMAL |普通云盘 |20-8000GB |不支持 | 是 | 是 | 1G | |
//| Ucloud |CLOUD_SSD |SSD云盘 |20-4000GB |20-500GB | 是 | 是 | 1G | |
//| Ucloud |LOCAL_NORMAL |普通本地盘 | | | 是 | 是 | 1G | |
//| Ucloud |LOCAL_SSD |SSD本地盘 | | | 是 | 是 | 1G | |
//| Ucloud |EXCLUSIVE_LOCAL_DISK |独享本地盘 | | | 是 | 是 | 1G | |
//| ZStack |localstorage |本地盘 | | | 是 | 是 | 1G | |
//| ZStack |ceph |云硬盘 | | | 是 | 是 | 1G | |
//| Google |local-ssd |本地SSD暂存盘 |375GB |不支持 | 否 | 否 | | 跟随实例创建一次最多添加8个 |
//| Google |pd-standard |标准永久性磁盘 |10-65536GB |10-65536GB | 是 | 是 | 1G | |
//| Google |pd-ssd |SSD永久性磁盘 |10-65536GB |10-65536GB | 是 | 是 | 1G | |
Backend string `json:"backend"`
//介质类型
//rotate: 机械盘
//ssd: 固态硬盘
//hybird: 混合盘
//emum: [rotate, ssd, hybrid]
//default: hybird
Medium string `json:"medium"`
//swagger:ignore
SizeMb int `json:"size"`
Fs string `json:"fs"`
Format string `json:"format"`
Driver string `json:"driver"`
Cache string `json:"cache"`
Mountpoint string `json:"mountpoint"`
Backend string `json:"backend"` // stroageType
Medium string `json:"medium"`
ImageProperties map[string]string `json:"image_properties"`
//存储ID, 指定存储后,磁盘会在此存储上创建
//存储列表可以参数 storage 列表API
//required: false
Storage string `json:"storage_id"`
//swagger:ignore
DiskId string `json:"disk_id"`
DiskId string `json:"disk_id"`
}
type IsolatedDeviceConfig struct {
@@ -231,92 +110,26 @@ type BaremetalDiskConfig struct {
}
type ServerConfigs struct {
// 调度使用指定的云账号
PreferManager string `json:"prefer_manager_id"`
// 调度到指定区域,优先级低于prefer_zone_id
PreferRegion string `json:"prefer_region_id"`
// 调度到指定可用区,优先级低于prefer_host_id
PreferZone string `json:"prefer_zone_id"`
// 调度使用指定二层网络, 优先级低于prefer_host_id
PreferWire string `json:"prefer_wire_id"`
// 调度使用指定宿主机
PreferHost string `json:"prefer_host_id"`
// 主机高可用时,将备机调度到指定宿主机, 此参数仅对KVM生效
// prefer options
PreferRegion string `json:"prefer_region_id"`
PreferZone string `json:"prefer_zone_id"`
PreferWire string `json:"prefer_wire_id"`
PreferHost string `json:"prefer_host_id"`
PreferBackupHost string `json:"prefer_backup_host"`
// 虚拟化技术或平台
//
//
//
// |hypervisor | 技术或平台 |
// |------- | ---------- |
// |kvm | 本地私有云 |
// |esxi | VMWare |
// |baremetal | 裸金属 |
// |aliyun | 阿里云 |
// |aws | 亚马逊 |
// |qcloud | 腾讯云 |
// |azure | 微软云 |
// |huawei | 华为云 |
// |openstack | OpenStack |
// |ucloud | Ucloud |
// |zstack | ZStack |
// |google | 谷歌云 |
// |ctyun | 天翼云 |
// default: kvm
Hypervisor string `json:"hypervisor"`
// 包年包月资源池
// swagger:ignore
// emum: shared, prepaid, dedicated
// ResourceType "shared|prepaid|dedicated"`
ResourceType string `json:"resource_type"`
// 套餐名称, 此参数优先级高于vcpu_count和vmem_size
// 套餐可以通过 serverskus 列表获取
// esxi, openstack, zstack等私有云都统一使用provider为OneCloud的套餐
// 公有云使用各自的套餐
InstanceType string `json:"instance_type"`
Backup bool `json:"backup"`
Count int `json:"count"`
// swagger:ignore
// Deprecated
// alias for InstanceType
Sku string `json:"sku" "yunion:deprecated-by":"instance_type"`
Disks []*DiskConfig `json:"disks"`
Networks []*NetworkConfig `json:"nets"`
Schedtags []*SchedtagConfig `json:"schedtags"`
IsolatedDevices []*IsolatedDeviceConfig `json:"isolated_devices"`
BaremetalDiskConfigs []*BaremetalDiskConfig `json:"baremetal_disk_configs"`
// 虚拟机高可用(创建备机)
// default: false
// requried: false
Backup bool `json:"backup"`
// 创建虚拟机数量
// default: 1
Count int `json:"count"`
// 磁盘列表,第一块磁盘为系统盘,需要指定image_id
// 若指定主机快照,此参数可以为空
// required: true
Disks []*DiskConfig `json:"disks"`
// 指定主机网络
// required: false
Networks []*NetworkConfig `json:"nets"`
// 调度标签
// required: false
Schedtags []*SchedtagConfig `json:"schedtags"`
// 透传设备列表
// required: false
IsolatedDevices []*IsolatedDeviceConfig `json:"isolated_devices"`
// 裸金属磁盘配置列表
BaremetalDiskConfigs []*BaremetalDiskConfig `json:"baremetal_disk_configs"`
// 主机组列表, 参数可以是主机组名称或ID,建议使用ID
InstanceGroupIds []string `json:"groups"`
// DEPRECATE
@@ -346,150 +159,53 @@ type ServerCreateInput struct {
*ServerConfigs
// 虚拟机内存大小,单位Mb,若未指定instance_type,此参数为必传项
VmemSize int `json:"vmem_size"`
// 虚拟机Cpu大小,若未指定instance_type,此参数为必传项
// default: 1
VcpuCount int `json:"vcpu_count"`
// 用户自定义启动脚本
// required: false
UserData string `json:"user_data"`
// Deprecated
// swagger:ignore
KeypairId string `json:"keypair_id" "yunion:deprecated-by":"keypair"`
// 秘钥对Id
// required: false
Keypair string `json:"keypair"`
// 密码
// 要求: 密码长度 >= 20, 至少包含一个数字一个小写字母一个大小字母及特殊字符~`!@#$%^&*()-_=+[]{}|:';\",./<>?中的一个
// requried: false
Password string `json:"password"`
// 使用ISO光盘启动, 仅KVM平台支持
// required: false
Cdrom string `json:"cdrom"`
// enum: cirros, vmware, qxl, std
// default: std
Vga string `json:"vga"`
// 远程连接协议
// enum: vnc, spice
// default: vnc
Vdi string `json:"vdi"`
// BIOS类型, 若镜像是Windows并且支持UEFI,则自动会设置为UEFI
// emulate: BIOS, UEFI
Bios string `json:"bios"`
// 启动顺序
// c: cdrome
// d: disk
// n: network
// example: cnd
// default: cdn
BootOrder string `json:"boot_order"`
// 启用cloud-init,需要镜像装有cloud-init服务
// default: false
EnableCloudInit bool `json:"enable_cloud_init"`
// 随机密码, 若指定password参数,此参数不生效
// 若值为false并且password为空,则表示保留镜像密码
ResetPassword *bool `json:"reset_password"`
// 关机后执行的操作
// terminate: 关机后自动删除
// emum: stop, terminate
// default: stop
ShutdownBehavior string `json:"shutdown_behavior"`
// 创建后自动启动
// 部分云创建后会自动启动例如: 腾讯云, AWS, OpenStack, ZStack, Ucloud, Huawei, Azure, 天翼云
// default: false
AutoStart bool `json:"auto_start"`
DeployConfigs []*DeployConfig `json:"deploy_configs"`
// 包年包月时长
//
//
// |平台 |是否支持 |
// |---- |------- |
// |KVM |否 |
// |ESxi |否 |
// |OpenStack |否 |
// |ZStack |否 |
// |Google |否 |
// |Azure |否 |
// |AWS |否 |
// |腾讯云 |是 |
// |Aliyun |是 |
// |Ucloud |是 |
// |Huawei |是 |
// |天翼云 |是 |
Duration string `json:"duration"`
VmemSize int `json:"vmem_size"`
VcpuCount int `json:"vcpu_count"`
UserData string `json:"user_data"`
Metadata map[string]string `json:"__meta__"`
// swagger:ignore
AutoPrepaidRecycle bool `json:"auto_prepaid_recycle,omitfalse"`
Keypair string `json:"keypair" deprecated-by:"keypair_id"`
KeypairId string `json:"keypair_id"`
Password string `json:"password"`
Cdrom string `json:"cdrom"`
Vga string `json:"vga"`
Vdi string `json:"vdi"`
Bios string `json:"bios"`
// Description string `json:"description"`
BootOrder string `json:"boot_order"`
EnableCloudInit bool `json:"enable_cloud_init"`
ResetPassword *bool `json:"reset_password"`
// DisableDelete *bool `json:"disable_delete"`
ShutdownBehavior string `json:"shutdown_behavior"`
AutoStart bool `json:"auto_start"`
DeployConfigs []*DeployConfig `json:"deploy_configs"`
// IsSystem bool `json:"is_system"`
Duration string `json:"duration"`
AutoPrepaidRecycle bool `json:"auto_prepaid_recycle,omitfalse"`
SecgroupId string `json:"secgrp_id"`
EipBw int `json:"eip_bw,omitzero"`
EipChargeType string `json:"eip_charge_type,omitempty"`
Eip string `json:"eip,omitempty"`
InstanceSnapshotId string `json:"instance_snapshot_id,omitempty"`
Secgroups []string `json:"secgroups"`
// 弹性公网IP带宽
// 指定此参数后会创建新的弹性公网IP并绑定到新建的虚拟机
// 私有云不支持此参数
EipBw int `json:"eip_bw,omitzero"`
// 弹性公网IP计费类型
EipChargeType string `json:"eip_charge_type,omitempty"`
// 弹性公网IP名称或ID
// 绑定已有弹性公网IP, 此参数会限制虚拟机再谈下公网IP所在的区域创建
// required: false
Eip string `json:"eip,omitempty"`
// 使用主机快照创建虚拟机, 主机快照不会重置密码及秘钥信息
// 使用主机快照创建的虚拟机将沿用之前的密码秘钥及安全组信息
// required: false
InstanceSnapshotId string `json:"instance_snapshot_id,omitempty"`
// 安全组Id, 此参数会和secgroups参数合并
SecgroupId string `json:"secgrp_id"`
// 安全组Id列表
Secgroups []string `json:"secgroups"`
// swagger:ignore
OsType string `json:"os_type"`
// Fill by server
OsProfile jsonutils.JSONObject `json:"__os_profile__"`
BillingType string `json:"billing_type"`
BillingCycle string `json:"billing_cycle"`
// swagger:ignore
OsProfile jsonutils.JSONObject `json:"__os_profile__"`
// swagger:ignore
BillingType string `json:"billing_type"`
// swagger:ignore
BillingCycle string `json:"billing_cycle"`
// swagger:ignore
// Deprecated
// 此参数等同于 hypervisor=baremetal
// DEPRECATE or not used fields
Baremetal bool `json:"baremetal"`
// Used to store BaremetalConvertHypervisorTaskId
ParentTaskId string `json:"__parent_task_id,omitempty"`
// 指定系统盘默认存储类型, 如果指定宿主机
// swagger:ignore
// default stroage type if host is given
DefaultStorageType string `json:"default_storage_type,omitempty"`
// 指定用于新建主机的主机镜像ID
GuestImageID string `json:"guest_image_id"`
}
func (input *ServerCreateInput) AfterUnmarshal() {
if input.Baremetal {
input.Hypervisor = HYPERVISOR_BAREMETAL
}
// Guest Image ID
GuestImageID string
}
type ServerCloneInput struct {

View File

@@ -49,13 +49,10 @@ type BucketCreateInput struct {
StorageClass string `json:"storage_class"`
}
type BucketDetails struct {
apis.VirtualResourceDetails
type BucketDetail struct {
apis.Meta
SBucket
CloudproviderInfo
AccessUrls []cloudprovider.SBucketAccessUrl `json:"access_urls"`
CloudproviderDetails
}
type BucketObjectsActionInput struct {
@@ -93,9 +90,3 @@ func (input *BucketMetadataInput) Validate() error {
}
return nil
}
type BucketListInput struct {
apis.VirtualResourceListInput
ManagedResourceListInput
}

View File

@@ -1,55 +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 CachedImageUncacheImageInput struct {
// 存储缓存名Id
// required: true
StoragecacheId string `json:"storagecache_id"`
// 是否强制清除缓存
// default: false
IsForce bool `json:"is_force"`
}
type CachedimageDetails struct {
apis.StandaloneResourceDetails
SCachedimage
// 镜像状态, 和info里面的status一致
// example: active
Status string `json:"status"`
// 操作系统类型
// example: FreeBSD
OsType string `json:"os_type"`
// 操作系统发行版
// example: FreeBSD
OsDistribution string `json:"os_distribution"`
// 操作系统版本
// example: 11
OsVersion string `json:"os_version"`
// 虚拟化类型
Hypervisor string `json:"hypervisor"`
// 此镜像被使用次数
// example: 0
CachedCount int `json:"cached_count"`
}

View File

@@ -19,7 +19,6 @@ import (
"yunion.io/x/pkg/utils"
"yunion.io/x/onecloud/pkg/apis"
proxyapi "yunion.io/x/onecloud/pkg/apis/cloudcommon/proxy"
"yunion.io/x/onecloud/pkg/cloudprovider"
"yunion.io/x/onecloud/pkg/httperrors"
)
@@ -27,60 +26,17 @@ import (
type CloudaccountCreateInput struct {
apis.EnabledStatusStandaloneResourceCreateInput
// 指定云平台
// Qcloud: 腾讯云
// Ctyun: 天翼云
// enum: VMware, Aliyun, Qcloud, Azure, Aws, Huawei, OpenStack, Ucloud, ZStack, Google, Ctyun
Provider string `json:"provider"`
// swagger:ignore
AccountId string
// 指定云平台品牌, 此参数默认和provider相同
// requried: false
//
//
//
// | provider | 支持的参数 |
// | -------- | ---------- |
// | VMware | VMware |
// | Aliyun | Aliyun |
// | Qcloud | Qcloud |
// | Azure | Azure |
// | Aws | Aws |
// | Huawei | Huawei |
// | OpenStack | OpenStack |
// | Ucloud | Ucloud |
// | ZStack | ZStack, DStack |
// | Google | Google |
// | Ctyun | Ctyun |
Brand string `json:"brand"`
// swagger:ignore
IsPublicCloud bool
// swagger:ignore
IsOnPremise bool
// 指定云账号所属的项目
Tenant string `json:"tenant"`
// swagger:ignore
TenantId string
// 启用自动同步
// default: false
EnableAutoSync bool `json:"enable_auto_sync"`
// 自动同步间隔时间
SyncIntervalSeconds int `json:"sync_interval_seconds"`
// 自动根据云上项目或订阅创建本地项目
// default: false
AutoCreateProject bool `json:"auto_create_project"`
// 额外信息,例如账单的access key
Options *jsonutils.JSONObject `json:"options"`
proxyapi.ProxySettingResourceInput
Provider string
AccountId string
Brand string
IsPublicCloud bool
IsOnPremise bool
Tenant string
TenantId string
EnableAutoSync bool
SyncIntervalSeconds int
AutoCreateProject bool
Options *jsonutils.JSONObject
cloudprovider.SCloudaccount
cloudprovider.SCloudaccountCredential
@@ -101,85 +57,3 @@ func (i CloudaccountShareModeInput) Validate() error {
}
return nil
}
type CloudaccountListInput struct {
apis.EnabledStatusStandaloneResourceListInput
ManagedResourceListInput
CapabilityListInput
}
type ProviderProject struct {
// 子订阅项目名称
// example: system
Tenant string `json:"tenant"`
// 子订阅项目Id
// 9a48383a-467a-4542-8b50-4e15b0a8715f
TenantId string `json:"tenant_id"`
}
type CloudaccountDetail struct {
apis.StandaloneResourceDetails
SCloudaccount
// 子订阅项目信息
Projects []ProviderProject `json:"projects"`
// 同步时间间隔
// example: 3600
SyncIntervalSeconds int `json:"sync_interval_seconds"`
// 同步状态
SyncStatus2 string `json:"sync_stauts2"`
// 云账号环境类型
// public: 公有云
// private: 私有云
// onpremise: 本地IDC
// example: public
CloudEnv string `json:"cloud_env"`
// 云账号项目名称
// example: system
Tenant string `json:"tenant"`
// 弹性公网Ip数量
// example: 2
EipCount int `json:"eip_count,allowempty"`
// 虚拟私有网络数量
// example: 4
VpcCount int `json:"vpc_count,allowempty"`
// 云盘数量
// example: 12
DiskCount int `json:"disk_count,allowempty"`
// 宿主机数量(不计算虚拟机宿主机数量)
// example: 0
HostCount int `json:"host_count,allowempty"`
// 云主机数量
// example: 4
GuestCount int `json:"guest_count,allowempty"`
// 块存储数量
// example: 12
StorageCount int `json:"storage_count,allowempty"`
// 子订阅数量
// example: 1
ProviderCount int `json:"provider_count,allowempty"`
// 路由表数量
// example: 0
RoutetableCount int `json:"routetable_count,allowempty"`
// 存储缓存数量
// example: 10
StoragecacheCount int `json:"storagecache_count,allowempty"`
ProxySetting proxyapi.SProxySetting `json:"proxy_setting"`
}

View File

@@ -14,274 +14,85 @@
package compute
import (
"yunion.io/x/pkg/utils"
"yunion.io/x/onecloud/pkg/apis"
proxyapi "yunion.io/x/onecloud/pkg/apis/cloudcommon/proxy"
"yunion.io/x/onecloud/pkg/cloudprovider"
)
type CloudproviderInfo struct {
// 云平台
// example: Google
Provider string `json:"provider,omitempty"`
// 云平台品牌
// example: Google
Brand string `json:"brand,omitempty"`
// 云账号名称
// example: google-account
Account string `json:"account,omitempty"`
// 云账号Id
// example: 4d3c8979-9dd0-439b-8d78-36fe1ab1666c
AccountId string `json:"account_id,omitempty"`
// 子订阅名称
// example: google-account
Manager string `json:"manager,omitempty"`
// 子订阅Id
// example: fa4aaf88-aed8-422d-84e7-56dea533b364
ManagerId string `json:"manager_id,omitempty"`
// 子订阅所在项目名称
// example: system
ManagerProject string `json:"manager_project,omitempty"`
// 子订阅所在项目Id
// example: 4d3c8979-9dd0-439b-8d78-36fe1ab1666c
ManagerProjectId string `json:"manager_project_id,omitempty"`
// 子订阅所在域名称
// example: Default
ManagerDomain string `json:"manager_domain,omitempty"`
// 子订阅所在域Id
// example: default
ManagerDomainId string `json:"manager_domain_id,omitempty"`
// 区域名称
// example: 腾讯云 华南地区(广州)
Region string `json:"region,omitempty"`
// 区域Id
// example: 6151c89b-77f2-4d43-8ef9-cd03d604a16b
RegionId string `json:"region_id,omitempty"`
// 区域Id
// example: 6151c89b-77f2-4d43-8ef9-cd03d604a16b
CloudregionId string `json:"cloudregion_id,omitempty"`
// 区域外部Id
// Qcloud/ap-guangzhou
RegionExternalId string `json:"region_external_id,omitempty"`
// 区域外部Id(不携带平台信息)
// example: ap-guangzhou
RegionExtId string `json:"region_ext_id,omitempty"`
// 可用区名称
// example: 腾讯云 广州四区
Zone string `json:"zone,omitempty"`
// 可用区Id
// example: 336ac6d2-b80d-43bb-86d5-1ebf474da8d4
ZoneId string `json:"zone_id,omitempty"`
// 可用区外部Id
// example: ap-guangzhou-4
ZoneExtId string `json:"zone_ext_id,omitempty"`
// 云环境
// example: public
CloudEnv string `json:"cloud_env,omitempty"`
}
type CloudproviderDetails struct {
apis.StandaloneResourceDetails
SCloudprovider
ProxySetting proxyapi.SProxySetting `json:"proxy_setting"`
// 云账号名称
// example: google-account
Cloudaccount string `json:"cloudaccount"`
// 子订阅同步状态
SyncStatus2 string `json:"sync_status2"`
// 支持服务列表
Capabilities []string `json:"capabilities"`
// 云主机数量
// example: 1
GuestCount int `json:"guest_count"`
// 宿主机数量
// example: 2
HostCount int `json:"host_count"`
// 虚拟私有网络数量
// example: 4
VpcCount int `json:"vpc_count"`
// 块存储梳理
// example: 4
StorageCount int `json:"storage_count"`
// 存储缓存数量
// example: 1
StorageCacheCount int `json:"storagecache_count"`
// 弹性公网IP数量
// example: 12
EipCount int `json:"eip_count"`
// 快照数量
// example: 0
SnapshotCount int `json:"snapshot_count"`
// 负载均衡器数量
// example: 2
LoadbalancerCount int `json:"loadbalancer_count"`
// 项目数量
ProjectCount int `json:"project_count"`
// 同步区域数量
SyncRegionCount int `json:"sync_region_count"`
// 子订阅品牌信息
Brand string `json:"brand"`
Provider string `json:"provider,omitempty"`
Brand string `json:"brand,omitempty"`
Account string `json:"account,omitempty"`
AccountId string `json:"account_id,omitempty"`
Manager string `json:"manager,omitempty"`
ManagerId string `json:"manager_id,omitempty"`
ManagerProject string `json:"manager_project,omitempty"`
ManagerProjectId string `json:"manager_project_id,omitempty"`
ManagerDomain string `json:"manager_domain,omitempty"`
ManagerDomainId string `json:"manager_domain_id,omitempty"`
Region string `json:"region,omitempty"`
RegionId string `json:"region_id,omitempty"`
CloudregionId string `json:"cloudregion_id,omitempty"`
RegionExternalId string `json:"region_external_id,omitempty"`
RegionExtId string `json:"region_ext_id,omitempty"`
Zone string `json:"zone,omitempty"`
ZoneId string `json:"zone_id,omitempty"`
ZoneExtId string `json:"zone_ext_id,omitempty"`
CloudEnv string `json:"cloud_env,omitempty"`
}
type ManagedResourceListInput struct {
// 列出关联指定云订阅(ID或Name)的资源
Cloudprovider string `json:"cloudprovider"`
type CloudaccountListInput struct {
// List objects belonging to the cloud provider
// swagger:ignore
// Deprecated
// description: this param will be deprecate at 3.0
Manager string `json:"manager" "yunion:deprecated-by":"cloudprovider"`
// swagger:ignore
// Deprecated
// description: this param will be deprecate at 3.0
ManagerId string `json:"manager_id" "yunion:deprecated-by":"cloudprovider"`
// swagger:ignore
// Deprecated
// description: this param will be deprecate at 3.0
CloudproviderId string `json:"cloudprovider_id" "yunion:deprecated-by":"cloudprovider"`
Cloudprovider string `json:"cloudprovider"`
// 列出关联指定云账号(ID或Name)的资源
// List objects belonging to the cloud provider
// deprecate:true
// description: this param will be deprecate at 3.0
Manager string `json:"manager"`
// deprecate:true
// description: this param will be deprecate at 3.0
ManagerId string `json:"manager_id"`
// deprecate:true
// description: this param will be deprecate at 3.0
CloudproviderId string `json:"cloudprovider_id"`
// List objects belonging to the cloud account
Cloudaccount string `json:"cloudaccount"`
// swagger:ignore
// Deprecated
// deprecate:true
// description: this param will be deprecate at 3.0
CloudaccountId string `json:"cloudaccount_id" "yunion:deprecated-by":"cloudaccount"`
// swagger:ignore
// Deprecated
CloudaccountId string `json:"cloudaccount_id"`
// deprecate:true
// description: this param will be deprecate at 3.0
Account string `json:"account" "yunion:deprecated-by":"cloudaccount"`
// swagger:ignore
// Deprecated
Account string `json:"account"`
// deprecate:true
// description: this param will be deprecate at 3.0
AccountId string `json:"account_id" "yunion:deprecated-by":"cloudaccount"`
AccountId string `json:"account_id"`
// 列出指定云平台的资源,支持的云平台如下
//
// | Provider | 开始支持版本 | 平台 |
// |-----------|------------|-------------------------------------|
// | OneCloud | 0.0 | OneCloud内置私有云包括KVM和裸金属管理 |
// | VMware | 1.2 | VMware vCenter |
// | OpenStack | 2.6 | OpenStack M版本以上私有云 |
// | ZStack | 2.10 | ZStack私有云 |
// | Aliyun | 2.0 | 阿里云 |
// | Aws | 2.3 | Amazon AWS |
// | Azure | 2.2 | Microsoft Azure |
// | Google | 2.13 | Google Cloud Platform |
// | Qcloud | 2.3 | 腾讯云 |
// | Huawei | 2.5 | 华为公有云 |
// | Ucloud | 2.7 | UCLOUD |
// | Ctyun | 2.13 | 天翼云 |
// | S3 | 2.11 | 通用s3对象存储 |
// | Ceph | 2.11 | Ceph对象存储 |
// | Xsky | 2.11 | XSKY启明星辰Ceph对象存储 |
//
// enum: OneCloud,VMware,Aliyun,Qcloud,Azure,Aws,Huawei,OpenStack,Ucloud,ZStack,Google,Ctyun,S3,Ceph,Xsky"
Providers []string `json:"providers"`
// swagger:ignore
// Deprecated
Provider []string `json:"provider" "yunion:deprecated-by":"providers"`
// List objects from the providers, choices:"OneCloud|VMware|Aliyun|Qcloud|Azure|Aws|Huawei|OpenStack|Ucloud|ZStack|Google"
Providers []string `json:"provider"`
// 列出指定云平台品牌的资源一般来说brand和provider相同除了以上支持的provider之外还支持以下band
//
// | Brand | Provider | 说明 |
// |----------|----------|------------|
// | DStack | ZStack | 滴滴云私有云 |
//
Brands []string `json:"brands"`
// swagger:ignore
// Deprecated
Brand []string `json:"brand" "yunion:deprecated-by":"brands"`
// List objects belonging to brands
Brands []string `json:"brand"`
}
// 列出指定云环境的资源,支持云环境如下:
//
// | CloudEnv | 说明 |
// |-----------|--------|
// | public | 公有云 |
// | private | 私有云 |
// | onpremise | 本地IDC |
//
// enum: public,private,onpremise
type CloudTypeListInput struct {
// enum: public_cloud,private_cloud,on_premise
CloudEnv string `json:"cloud_env"`
// swagger:ignore
// Deprecated
// deprecate:true
// description: this param will be deprecate at 3.0
PublicCloud bool `json:"public_cloud"`
// swagger:ignore
// Deprecated
// deprecate:true
// description: this param will be deprecate at 3.0
IsPublic bool `json:"is_public"`
// swagger:ignore
// Deprecated
// deprecate:true
// description: this param will be deprecate at 3.0
PrivateCloud bool `json:"private_cloud"`
// swagger:ignore
// Deprecated
// deprecate:true
// description: this param will be deprecate at 3.0
IsPrivate bool `json:"is_private"`
// swagger:ignore
// Deprecated
// deprecate:true
// description: this param will be deprecate at 3.0
IsOnPremise bool `json:"is_on_premise"`
// 过滤资源是否为非OneCloud内置私有云管理的资源
// List objects managed by external providers
// default: false
IsManaged bool `json:"is_managed"`
}
func (input *ManagedResourceListInput) AfterUnmarshal() {
if len(input.CloudEnv) > 0 {
return
}
if input.PublicCloud || input.IsPublic {
input.CloudEnv = CLOUD_ENV_PUBLIC_CLOUD
} else if input.PrivateCloud || input.IsPrivate {
input.CloudEnv = CLOUD_ENV_PRIVATE_CLOUD
} else if input.IsOnPremise {
input.CloudEnv = CLOUD_ENV_ON_PREMISE
}
}
type CapabilityListInput struct {
// 根据该云平台的功能对云账号或云订阅进行过滤
Capability []string `json:"capability"`
// swagger:ignore
// Deprecated
// filter by HasObjectStorage
HasObjectStorage *bool `json:"has_object_storage"`
}
type CloudproviderListInput struct {
apis.EnabledStatusStandaloneResourceListInput
ManagedResourceListInput
UsableResourceListInput
CapabilityListInput
}
func (input *CapabilityListInput) AfterUnmarshal() {
if input.HasObjectStorage != nil && *input.HasObjectStorage && !utils.IsInStringArray(cloudprovider.CLOUD_CAPABILITY_OBJECTSTORE, input.Capability) {
input.Capability = append(input.Capability, cloudprovider.CLOUD_CAPABILITY_OBJECTSTORE)
}
}

View File

@@ -1,41 +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 CloudproviderregionDetails struct {
apis.JoinModelBaseDetails
Cloudprovider string
Cloudregion string
// 云账号Id
// example: fa4aaf88-aed8-422d-84e7-56dea533b364
CloudaccountId string `json:"cloudaccount_id"`
// 云账号名称
// example: googl-account
Cloudaccount string `json:"cloudaccount"`
// 云账号所在域Id
// example: 0df40413-eb69-49c7-895e-618ddeb80f55
CloudaccountDomainId string `json:"cloudaccount_domain_id"`
// 是否开启自动同步
// example: false
EnableAutoSync bool `json:"enable_auto_sync"`
// 自动同步周期
// example: 300
SyncIntervalSeconds int `json:"sync_interval_seconds"`
}

View File

@@ -1,56 +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 CloudregionDetails struct {
apis.StandaloneResourceDetails
SCloudregion
// 虚拟私有网络数量
// example: 2
VpcCount int `json:"vpc_count,allowempty"`
// 可用区数量
// example: 3
ZoneCount int `json:"zone_count,allowempty"`
// 云主机梳理
// example: 2
GuestCount int `json:"guest_count,allowempty"`
// IP子网数量
// example: 12
NetworkCount int `json:"network_count,allowempty"`
// 距离前天0点新增云主机数量
// example: 0
GuestIncrementCount int `json:"guest_increment_count,allowempty"`
}
type CloudregionInfo struct {
// 区域的名称
// example: Default
Region string `json:"region"`
// 区域的Id
// example: default
RegionId string `json:"region_id"`
// 纳管云区域的组合Id(平台+Id)
// example: ZStack/59e7bc87-a6b3-4c39-8f02-c68e8243d4e4
RegionExternalId string `json:"region_external_id"`
// 纳管云区域的Id
// example: 59e7bc87-a6b3-4c39-8f02-c68e8243d4e4
RegionExtId string `json:"region_ext_id"`
}

View File

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

View File

@@ -16,131 +16,38 @@ package compute
import "yunion.io/x/onecloud/pkg/apis"
type DBInstanceCreateInput struct {
apis.VirtualResourceCreateInput
DeletePreventableCreateInput
type SDBInstanceCreateInput struct {
apis.Meta
// Ip子网名称或Id,建议使用Id
// required: true
Network string `json:"network"`
// swagger:ignore
NetworkId string
// Ip子网内的地址,不填则按照ip子网的地址分配策略分配一个ip
// required: false
Address string `json:"address"`
// rds实例名称或Id,建议使用Id
// 创建只读实例时此参数必传
MasterInstance string `json:"master_instance"`
// swagger:ignore
MasterInstanceId string
// 安全组名称或Id
// default: default
Secgroup string `json:"secgroup"`
// swagger:ignore
SecgroupId string
// 主可用区名称或Id, 此参数从指定的套餐所在的可用区获取
Zone1 string `json:"zone1"`
// 次可用区名称或Id, 此参数从指定的套餐所在的可用区获取
Zone2 string `json:"zone2"`
// 三节点可用区名称或Id,, 此参数从指定的套餐所在的可用区获取
Zone3 string `json:"zone3"`
// swagger:ignore
ZoneId string
// 区域名称或Id建议使用Id
// swagger:ignore
Cloudregion string `json:"cloudregion"`
// swagger:ignore
CloudregionId string
// swagger:ignore
VpcId string
// swagger:ignore
ManagerId string
// swagger:ignore
Name string
Description string
DisableDelete *bool
NetworkId string
Address string
MasterInstanceId string
SecgroupId string
Zone1 string
Zone2 string
Zone3 string
ZoneId string
CloudregionId string
Cloudregion string
VpcId string
ManagerId string
NetworkExternalId string
BillingType string
BillingCycle string
InstanceType string
Engine string
EngineVersion string
Category string
StorageType string
DiskSizeGB int
Password string
// 包年包月时间周期
Duration string `json:"duration"`
// swagger:ignore
BillingType string
// swagger:ignore
BillingCycle string
// 套餐名称, 若此参数不填, 则必须有vmem_size_mb及vcpu_count参数
// 套餐列表可以通过 dbinstancesku 获取
InstanceType string `json:"instance_type"`
// rds引擎
// enum: MySQL, SQLServer, PostgreSQL, MariaDB, Oracle, PPAS
// required: true
Engine string `json:"engine"`
// rds引擎版本
// 根据各个引擎版本各不相同
// required: true
EngineVersion string `json:"engine_version"`
// rds类型
//
//
//
// | 平台 | 支持类型 |
// | ----- | ------ |
// | 华为云 |ha, single, replica|
// | 阿里云 |basic, high_availability, always_on, finance|
// 翻译:
// basic: 基础版
// high_availability: 高可用
// always_on: 集群版
// finance: 金融版, 三节点
// ha: 高可用
// single: 单机
// replica: 只读
// required: true
Category string `json:"category"`
// rds存储类型
//
//
//
// | 平台 | 支持类型 |
// | 华为云 |SSD, SAS, SATA|
// | 阿里云 |local_ssd, cloud_essd, cloud_ssd|
// required: true
StorageType string `json:"storage_type"`
// rds存储大小
// 可参考rds套餐的大小范围和步长情况
// required: true
DiskSizeGB int `json:"disk_size_gb"`
// rds初始化密码
// 阿里云不需要此参数
// 华为云会默认创建一个用户,若不传此参数, 则为随机密码
Password string `json:"password"`
// rds实例cpu大小
// 若指定实例套餐,此参数将根据套餐设置
VcpuCount int `json:"vcpu_count"`
// rds实例内存大小
// 若指定实例套餐,此参数将根据套餐设置
VmemSizeMb int `json:"vmem_size_mb"`
// swagger:ignore
Provider string
VcpuCount int
VmemSizeMb int
Provider string
}
type SDBInstanceChangeConfigInput struct {
@@ -159,79 +66,5 @@ type SDBInstanceRecoveryConfigInput struct {
DBInstancebackup string
DBInstancebackupId string `json:"dbinstancebackup_id"`
Databases map[string]string `json:"databases,allowempty"`
}
type DBInstanceListInput struct {
apis.VirtualResourceListInput
ZonalFilterListInput
ManagedResourceListInput
VpcFilterListInput
}
type DBInstanceBackupListInput struct {
apis.VirtualResourceListInput
ManagedResourceListInput
RegionalFilterListInput
DbinstanceFilterListInput
}
type DBInstancePrivilegeListInput struct {
apis.ResourceBaseListInput
// filter by dbinstanceaccount
Dbinstanceaccount string `json:"dbinstanceaccount"`
// filter by dbinstancedatabase
Dbinstancedatabase string `json:"dbinstancedatabase"`
}
type DBInstanceParameterListInput struct {
apis.StandaloneResourceListInput
DbinstanceFilterListInput
}
type DBInstanceDatabaseListInput struct {
apis.StatusStandaloneResourceListInput
DbinstanceFilterListInput
}
type DBInstanceAccountListInput struct {
apis.StatusStandaloneResourceListInput
DbinstanceFilterListInput
}
type DbinstanceFilterListInput struct {
// filter by dbinstance
Dbinstance string `json:"dbinstance"`
// swagger:ignore
// Deprecated
// filter by dbinstance_id
DbinstanceId string `json:"dbinstance_id" "yunion:deprecated-by":"dbinstance"`
}
type DBInstanceDetails struct {
apis.VirtualResourceDetails
SDBInstance
CloudproviderInfo
// 虚拟私有网络名称
// example: test-vpc
Vpc string `json:"vpc"`
// 安全组名称
// example: Default
Secgroup string `json:"secgroup"`
// iops
// example: 0
Iops int `json:"iops"`
// IP子网名称
// example: test-network
Network string `json:"network"`
// 标签信息
Metadata map[string]string `json:"metadata"`
Databases map[string]string `json:"allowempty"`
}

View File

@@ -17,72 +17,21 @@ package compute
import "yunion.io/x/onecloud/pkg/apis"
type SDBInstanceAccountPrivilege struct {
// 数据库名称或Id
// required: true
Database string `json:"database"`
// swagger:ignore
Database string
DBInstancedatabaseId string
// 权限类型
//
//
//
// | 平台 |Rds引擎 | 支持类型 |
// | ---- |------- | -------- |
// | Aliyun |MySQL, MariaBD | rw, r, ddl, dml |
// | Aliyun |SQLServer | rw, r, owner |
// | Huawei |MySQL, MariaDB | rw, r |
// 同一平台不同的rds类型支持的权限不尽相同
// required: true
Privilege string `json:"privilege"`
Privilege string
}
type DBInstanceAccountCreateInput struct {
apis.StatusStandaloneResourceCreateInput
type SDBInstanceAccountCreateInput struct {
apis.Meta
// rds实例名称或Id,建议使用Id
//
//
//
// | 平台 |支持Rds引擎 |
// | ---- |------- |
// | Aliyun |MySQL, MariaBD, SQLServer |
// | 华为云 |MySQL, MariaBD |
// required: true
// 阿里云SQL Server 2017集群版不支持创建账号
// 实例状态必须是运行中
DBInstance string `json:"dbinstance"`
// swagger:ignore
DBInstanceId string `json:"dbinstance_id"`
// 账号密码,若不指定,则会随机生成
// required: false
Password string `json:"password"`
// 账号权限
// required: false
Privileges []SDBInstanceAccountPrivilege `json:"privileges"`
Name string
Description string
Password string
Privileges []SDBInstanceAccountPrivilege
}
type SDBInstanceSetPrivilegesInput struct {
Privileges []SDBInstanceAccountPrivilege `json:"privileges"`
}
type DBInstancePrivilege struct {
// 数据库名称
Database string
// 账号名称
Account string
// 数据库Id
DBInstancedatabaseId string
// 权限
Privileges string
}
type DBInstanceAccountDetails struct {
apis.StandaloneResourceDetails
SDBInstanceAccount
// 账号权限列表
DBInstanceprivileges []DBInstancePrivilege `json:"dbinstanceprivileges,allowempty"`
Privileges []SDBInstanceAccountPrivilege
}

View File

@@ -16,39 +16,17 @@ package compute
import "yunion.io/x/onecloud/pkg/apis"
type DBInstanceBackupCreateInput struct {
apis.VirtualResourceCreateInput
type SDBInstanceBackupCreateInput struct {
apis.Meta
// Rds实例名称或Id, 建议使用Id
// required: true
DBInstance string `json:"dbinstance"`
// swagger:ignore
DBInstanceId string `json:"dbinstance_id"`
// 需要备份的Rds数据库列表
// required: false
Databases []string `json:"databases"`
// swagger:ignore
DBNames string
// swagger:ignore
Engine string
// swagger:ignore
DBInstanceId string `json:"dbinstance_id"`
Name string
Description string
DBNames string
Databases []string
Engine string
EngineVersion string
// swagger:ignore
CloudregionId string
// swagger:ignore
BackupMode string
// swagger:ignore
ManagerId string
}
type DBInstanceBackupDetails struct {
apis.VirtualResourceDetails
SDBInstanceBackup
// RDS实例名称
DBInstance string `json:"dbinstance"`
CloudproviderInfo
BackupMode string
ManagerId string
}

View File

@@ -17,54 +17,18 @@ package compute
import "yunion.io/x/onecloud/pkg/apis"
type SDBInstanceDatabasePrivilege struct {
// 数据库账号名称或Id
// required: true
Account string `json:"account"`
// swagger:ignore
Account string
DBInstanceaccountId string
// 权限
// | 平台 |Rds引擎 | 支持类型 |
// | ---- |------- | -------- |
// | Aliyun |MySQL, MariaBD | rw, r, ddl, dml |
// | Aliyun |SQLServer | rw, r, owner |
// | Huawei |MySQL, MariaDB | rw, r |
// 同一平台不同的rds类型支持的权限不尽相同
// required: true
Privilege string `json:"privilege"`
Privilege string
}
type DBInstanceDatabaseCreateInput struct {
apis.StatusStandaloneResourceCreateInput
type SDBInstanceDatabaseCreateInput struct {
apis.Meta
// rds实例名称或Id,建议使用Id
//
//
//
// | 平台 |支持Rds引擎 |
// | ---- |------- |
// | Aliyun |MySQL, MariaBD, SQLServer |
// | 华为云 |MySQL, MariaBD |
// required: true
// 阿里云SQL Server 2017集群版不支持创建数据库
// 阿里云只读实例不支持创建数据库
// 实例状态必须是运行中
DBInstance string `json:"dbinstance"`
// swagger:ignore
DBInstanceId string `json:"dbinstance_id"`
// 数据库字符集
// required: true
CharacterSet string `json:"character_set"`
// 赋予账号权限
// required: false
Accounts []SDBInstanceDatabasePrivilege `json:"accounts"`
}
type DBInstancedatabaseDetails struct {
apis.StandaloneResourceDetails
SDBInstanceDatabase
// 数据库权限
DBInstanceprivileges []DBInstancePrivilege `json:"dbinstanceprivileges"`
DBInstanceId string `json:"dbinstance_id"`
CharacterSet string
Name string
Description string
Accounts []SDBInstanceDatabasePrivilege
DBInstanceaccountId string
}

View File

@@ -15,8 +15,6 @@
package compute
import (
"time"
"yunion.io/x/onecloud/pkg/apis"
)
@@ -25,25 +23,15 @@ type DiskCreateInput struct {
*DiskConfig
// 此参数仅适用于未指定storage时进行调度到指定区域创建磁盘
// required: false
// prefer options
PreferRegion string `json:"prefer_region_id"`
PreferZone string `json:"prefer_zone_id"`
PreferWire string `json:"prefer_wire_id"`
PreferHost string `json:"prefer_host_id"`
// 此参数仅适用于未指定storage时进行调度到指定可用区区创建磁盘
// required: false
PreferZone string `json:"prefer_zone_id"`
// swagger:ignore
PreferWire string `json:"prefer_wire_id"`
// 此参数仅适用于未指定storage时进行调度到指定可用区区创建磁盘
// required: false
PreferHost string `json:"prefer_host_id"`
// 此参数仅适用于未指定storage时进行调度到指定平台创建磁盘
// default: kvm
// enum: kvm, openstack, esxi, aliyun, aws, qcloud, azure, huawei, openstack, ucloud, zstack google, ctyun
Hypervisor string `json:"hypervisor"`
// Project string `json:"project"`
// Domain string `json:"domain_id"`
}
// ToServerCreateInput used by disk schedule
@@ -82,101 +70,3 @@ func (req *ServerCreateInput) ToDiskCreateInput() *DiskCreateInput {
input.Domain = req.Domain
return &input
}
type SnapshotPolicyFilterListInput struct {
// filter disk by snapshotpolicy
Snapshotpolicy string `json:"snapshotpolicy"`
// swagger:ignore
// Deprecated
// filter disk by snapshotpolicy_id
SnapshotpolicyId string `json:"snapshotpolicy_id" "yunion:deprecated-by":"snapshotpolicy"`
}
type DiskListInput struct {
apis.VirtualResourceListInput
ManagedResourceListInput
BillingFilterListInput
StorageFilterListInput
StorageShareFilterListInput
SnapshotPolicyFilterListInput
ServerFilterListInput
// filter disk by whether it is being used
Unused *bool `json:"unused"`
// swagger:ignore
// Deprecated
// filter by disk type
Type string `json:"type" "yunion:deprecated-by":"disk_type"`
// 过滤指定disk_type的磁盘列表可能的值为sys, data, swap. volume
//
// | disk_type值 | 说明 |
// |-------------|----------|
// | sys | 虚拟机系统盘 |
// | data | 虚拟机数据盘 |
// | swap | 虚拟机内存交换盘 |
// | volume | 容器volumn盘 |
//
DiskType string `json:"disk_type"`
}
type DiskFilterListInput struct {
// 以指定虚拟磁盘ID或Name过滤列表结果
Disk string `json:"disk"`
// swagger:ignore
// Deprecated
// filter by disk_id
DiskId string `json:"disk_id" "yunion:deprecated-by":"disk"`
}
type SimpleGuest struct {
Name string `json:"name"`
Id string `json:"id"`
Status string `json:"status"`
}
type SimpleSnapshotPolicy struct {
Id string `json:"id"`
Name string `json:"name"`
RepeatWeekdays []int `json:"repeat_weekdays"`
TimePoints []int `json:"time_points"`
}
type DiskDetails struct {
apis.VirtualResourceDetails
SDisk
CloudproviderInfo
// 云平台
Provider string `json:"provider"`
// 存储名称
Storage string `json:"storage"`
// 存储类型
StorageType string `json:"storage_type"`
// 介质类型
MediumType string `json:"medium_type"`
// 所挂载的虚拟机
Guests []SimpleGuest `json:"guests"`
// 所挂载的虚拟机
Guest string `json:"guest"`
// 所挂载虚拟机的数量
GuestCount int `json:"guest_count"`
// 所挂载虚拟机状态
GuestStatus string `json:"guest_status"`
// 自动清理时间
AutoDeleteAt time.Time `json:"auto_delete_at"`
// 自动快照策略状态
SnapshotpolicyStatus string `json:"snapshotpolicy_status,allowempty"`
// 自动快照策略
Snapshotpolicies []SimpleSnapshotPolicy `json:"snapshotpolicies"`
// 手动快照数量
ManualSnapshotCount int `json:"manual_snapshot_count"`
// 最多可创建手动快照数量
MaxManualSnapshotCount int `json:"max_manual_snapshot_count"`
}

View File

@@ -1,25 +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 DynamicschedtagDetails struct {
apis.StandaloneResourceDetails
SDynamicschedtag
Schedtag string `json:"schedtag"`
ResourceType string `json:"resource_type"`
}

View File

@@ -14,10 +14,6 @@
package compute
import (
"yunion.io/x/onecloud/pkg/apis"
)
const (
ELASTIC_CACHE_STATUS_RUNNING = "running" //(正常)
ELASTIC_CACHE_STATUS_RESTARTING = "restarting" //(重启中)
@@ -106,28 +102,3 @@ const (
ELASTIC_CACHE_ARCH_TYPE_CLUSTER = "cluster" // 集群
ELASTIC_CACHE_ARCH_TYPE_RWSPLIT = "rwsplit" // 读写分离
)
type ElasticcacheListInput struct {
apis.VirtualResourceListInput
ZonalFilterListInput
VpcFilterListInput
ManagedResourceListInput
}
type ElasticcacheAccountListInput struct {
apis.StatusStandaloneResourceListInput
}
type ElasticcacheAclListInput struct {
apis.StandaloneResourceListInput
}
type ElasticcacheBackupListInput struct {
apis.StatusStandaloneResourceListInput
}
type ElasticcacheParameterListInput struct {
apis.StandaloneResourceListInput
}

View File

@@ -1,29 +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 ElasticcacheBackupDetails struct {
apis.StandaloneResourceDetails
SElasticcacheBackup
CloudproviderInfo
// 引擎
Engine string `json:"engine"`
// 引擎版本
EngineVersion string `json:"engine_version"`
}

View File

@@ -1,22 +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 ElasticcacheSkuDetails struct {
apis.StandaloneResourceDetails
SElasticcacheSku
}

View File

@@ -1,79 +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 SElasticipCreateInput struct {
apis.VirtualResourceCreateInput
// 区域名称或Id, 建议使用Id
// 在指定区域内创建弹性公网ip
Cloudregion string `json:"cloudregion"`
// swagger:ignore
Region string
// swagger:ignore
RegionId string
// swagger:ignore
CloudregionId string
// 子订阅Id, 建议使用Id
// 使用指定子订阅创建弹性公网ip
// 弹性公网ip和虚拟机在同一区域同一子订阅底下才可以进行绑定操作
Cloudprovider string `json:"cloudprovider"`
// swagger:ignore
Manager string
// swagger:ignore
ManagerId string
// 计费类型: 流量或带宽
//
//
//
// | 平台 | 支持类型 |
// | --- | -------- |
// |Aliyun | traffic, bandwidth |
// |腾讯云 | traffic |
// |Azure | traffic |
// |Google | traffic, bandwidth |
// |Ucloud | traffic |
// |Aws | traffic |
// |华为云 | traffic, bandwidth |
// |天翼云 | traffic, bandwidth |
// |KVM | 不支持创建 |
// |VMware | 不支持创建 |
// |ZStack | traffic |
// |OpenStack | traffic |
// default: traffic
// enum: traffic, bandwidth
ChargeType string `json:"charge_type"`
// 子网名称或Id
// 私有云创建此参数必传,例如Openstack, ZStack
Network string `json:"network"`
// swagger:ignore
NetworkId string
}
type ElasticipDetails struct {
apis.VirtualResourceDetails
SElasticip
CloudproviderInfo
// 绑定资源名称
AssociateName string `json:"associate_name"`
}

View File

@@ -14,10 +14,6 @@
package compute
import (
"yunion.io/x/onecloud/pkg/apis"
)
const (
EIP_MODE_INSTANCE_PUBLICIP = "public_ip"
EIP_MODE_STANDALONE_EIP = "elastic_ip"
@@ -48,16 +44,3 @@ const (
var (
EIP_ASSOCIATE_VALID_TYPES = []string{EIP_ASSOCIATE_TYPE_SERVER, EIP_ASSOCIATE_TYPE_NAT_GATEWAY}
)
type ElasticipListInput struct {
apis.VirtualResourceListInput
ManagedResourceListInput
RegionalFilterListInput
UsableResourceListInput
// filter usable eip for given associate type
UsableEipForAssociateType string `json:"usable_eip_for_associate_type"`
// filter usable eip for given associate id
UsableEipForAssociateId string `json:"usable_eip_for_associate_id"`
}

View File

@@ -1,26 +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 ExternalProjectDetails struct {
apis.StandaloneResourceDetails
SExternalProject
CloudproviderInfo
Tenant string `json:"tenant"`
}

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 (
"yunion.io/x/onecloud/pkg/apis"
)
type RegionalFilterListInput struct {
// 过滤位于指定城市区域的资源
City string `json:"city"`
// 过滤处于指定区域内的资源
Cloudregion string `json:"cloudregion"`
// swagger:ignore
// Deprecated
// description: this param will be deprecate at 3.0
CloudregionId string `json:"cloudregion_id" "yunion:deprecated-by":"cloudregion"`
// swagger:ignore
// Deprecated
// description: this param will be deprecate at 3.0
Region string `json:"region" "yunion:deprecated-by":"cloudregion"`
// swagger:ignore
// Deprecated
// description: this param will be deprecate at 3.0
RegionId string `json:"region_id" "yunion:deprecated-by":"cloudregion"`
}
type ZonalFilterListInput struct {
RegionalFilterListInput
// 过滤处于指定可用区内的资源
Zone string `json:"zone"`
// swagger:ignore
// Deprecated
// filter by zone_id
ZoneId string `json:"zone_id" "yunion:deprecated-by":"zone"`
// 过滤处于多个指定可用区内的资源
Zones []string `json:"zones"`
}
func (input ZonalFilterListInput) ZoneList() []string {
zoneStr := input.Zone
if len(zoneStr) > 0 {
input.Zones = append(input.Zones, zoneStr)
}
return input.Zones
}
type HostFilterListInput struct {
ZonalFilterListInput
// 过滤关联指定宿主机ID或Name的列表结果
Host string `json:"host"`
// swagger:ignore
// Deprecated
// filter by host_id
HostId string `json:"host_id" "yunion:deprecated-by":"host"`
}
type CloudregionListInput struct {
apis.EnabledStatusStandaloneResourceListInput
apis.DomainizedResourceListInput
ManagedResourceListInput
UsableResourceListInput
UsableVpcResourceListInput
// 过滤位于指定城市的区域
City string `json:"city"`
// 过滤提供特定服务的区域
Service string `json:"service"`
}
type ZoneListInput struct {
apis.StatusStandaloneResourceListInput
apis.DomainizedResourceListInput
ManagedResourceListInput
RegionalFilterListInput
UsableResourceListInput
UsableVpcResourceListInput
// 过滤提供特定服务的可用区
Service string `json:"service"`
}

View File

@@ -21,8 +21,3 @@ import (
type GlobalVpcCreateInput struct {
apis.EnabledStatusStandaloneResourceCreateInput
}
type GlobalVpcDetails struct {
apis.StandaloneResourceDetails
SGlobalVpc
}

View File

@@ -155,7 +155,8 @@ const (
CPU_MODE_HOST = "host"
)
var VM_RUNNING_STATUS = []string{VM_START_START, VM_STARTING, VM_RUNNING, VM_BLOCK_STREAM, VM_BLOCK_STREAM_FAIL}
var VM_RUNNING_STATUS = []string{VM_START_START, VM_STARTING, VM_RUNNING, VM_BLOCK_STREAM}
var VM_CREATING_STATUS = []string{VM_CREATE_NETWORK, VM_CREATE_DISK, VM_START_DEPLOY, VM_DEPLOYING}
var HYPERVISORS = []string{
@@ -234,10 +235,9 @@ var HOSTTYPE_HYPERVISOR = map[string]string{
}
const (
VM_AWS_DEFAULT_LOGIN_USER = "ec2user"
VM_AWS_DEFAULT_WINDOWS_LOGIN_USER = "Administrator"
VM_AZURE_DEFAULT_LOGIN_USER = "toor"
VM_ZSTACK_DEFAULT_LOGIN_USER = "root"
VM_AWS_DEFAULT_LOGIN_USER = "ec2user"
VM_AZURE_DEFAULT_LOGIN_USER = "toor"
VM_ZSTACK_DEFAULT_LOGIN_USER = "root"
VM_METADATA_APP_TAGS = "app_tags"
VM_METADATA_CREATE_PARAMS = "create_params"

View File

@@ -1,45 +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 GuestDiskDetails struct {
apis.JoinModelBaseDetails
SGuestdisk
// 云主机名称
Guest string
// 云主机名称
Server string
// 磁盘名称
Disk string
// 存储类型
// example: local
StorageType string `json:"storage_type"`
// 磁盘大小, 单位Mb
// example: 10240
DiskSize int `json:"disk_size"`
// 磁盘状态
// example: ready
Status string `json:"status"`
// 磁盘类型
// example: data
DiskType string `json:"disk_type"`
// 介质类型
// example: ssd
MediumType string `json:"medium_type"`
}

View File

@@ -1,29 +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 GuestnetworkDetails struct {
apis.JoinModelBaseDetails
SGuestnetwork
// 云主机名称
Guest string
// 云主机名称
Server string
// IP子网名称
Network string
}

View File

@@ -15,81 +15,60 @@
package compute
import (
"time"
"yunion.io/x/jsonutils"
"yunion.io/x/onecloud/pkg/apis"
)
type ServerFilterListInput struct {
// 以关联主机ID或Name过滤列表
Server string `json:"server"`
// swagger:ignore
// Deprecated
// Filter by guest Id
ServerId string `json:"server_id" "yunion:deprecated-by":"server"`
// swagger:ignore
// Deprecated
// Filter by guest Id
Guest string `json:"guest" "yunion:deprecated-by":"server"`
// swagger:ignore
// Deprecated
// Filter by guest Id
GuestId string `json:"guest_id" "yunion:deprecated-by":"server"`
}
type ServerListInput struct {
apis.VirtualResourceListInput
apis.BaseListInput
ManagedResourceListInput
HostFilterListInput
NetworkFilterListInput
BillingFilterListInput
GroupFilterListInput
SecgroupFilterListInput
DiskFilterListInput
// 只列出裸金属主机
// 过滤可用区底下的资源
Zone string `json:"zone"`
// 过滤连接此二层网络的资源
Wire string `json:"wire"`
// 过滤关联此网络的资源
Network string `json:"network"`
// Disk ID or Name
Disk string `json:"disk"`
// Host ID or Name
Host string `json:"host"`
// Show baremetal servers
Baremetal *bool `json:"baremetal"`
// 只列出GPU主机
// Show gpu servers
Gpu *bool `json:"gpu"`
// 列出管理安全组为指定安全组的主机
// Secgroup ID or Name
Secgroup string `json:"secgroup"`
// AdminSecgroup ID or Name
AdminSecgroup string `json:"admin_security"`
// 列出Hypervisor为指定值的主机
// enum: kvm,esxi,baremetal,aliyun,azure,aws,huawei,ucloud,zstack,openstack,google,ctyun"`
Hypervisor []string `json:"hypervisor"`
// 列出绑定了弹性IPEIP的主机
// Show server of hypervisor choices:"kvm|esxi|container|baremetal|aliyun|azure|aws|huawei|ucloud|zstack|openstack"`
Hypervisor string `json:"hypervisor"`
// Show servers in cloudregion
Region string `json:"region"`
// Show Servers with EIP
WithEip *bool `json:"with_eip"`
// 列出未绑定弹性IPEIO的主机
// Show Servers without EIP
WithoutEip *bool `json:"without_eip"`
// 列出操作系统为指定值的主机
// enum: linux,windows,vmware
// OS Type choices:"linux|windows|vmware"`
OsType string `json:"os_type"`
// 对列表结果按照磁盘进行排序
// enum: asc,desc
// Order by disk size choices:"asc|desc"
OrderByDisk string `json:"order_by_disk"`
// 对主机列表结果按照宿主机名称进行排序
// enum: asc,desc
// Order by host name choices:"asc|desc"
OrderByHost string `json:"order_by_host"`
// 列出可以挂载指定EIP的主机
// Vpc id or name
Vpc string `json:"vpc"`
// Eip id or name
UsableServerForEip string `json:"usable_server_for_eip"`
// 按主机资源类型进行排序
// enum: shared,prepaid,dedicated
// Show Servers without user metadata
WithoutUserMeta *bool `json:"without_user_meta"`
// Instance Group ID or Name
Group string `json:"group"`
// Resource type choices:"shared|prepaid|dedicated"
ResourceType string `json:"resource_type"`
// 返回开启主备机功能的主机
GetBackupGuestsOnHost *bool `json:"get_backup_guests_on_host"`
// Billing type choices:"postpaid|prepaid"
BillingType string `json:"billing_type"`
// 根据宿主机 SN 过滤
HostSn string `json:"host_sn"`
}
func (input *ServerListInput) AfterUnmarshal() {
if input.Baremetal != nil && *input.Baremetal {
input.Hypervisor = append(input.Hypervisor, HYPERVISOR_BAREMETAL)
}
}
type ServerRebuildRootInput struct {
apis.Meta
@@ -129,51 +108,3 @@ func (i ServerRebuildRootInput) GetKeypairName() string {
type ServerResumeInput struct {
apis.Meta
}
type ServerDetails struct {
apis.VirtualResourceDetails
SGuest
CloudproviderInfo
// details
// 网络概要
Networks string `json:"networks"`
// 磁盘概要
Disks string `json:"disks"`
// 磁盘详情
DisksInfo *jsonutils.JSONArray `json:"disks_info"`
// 虚拟机Ip列表
VirtualIps string `json:"virtual_ips"`
// 安全组规则
SecurityRules string `json:"security_rules"`
// 操作系统名称
OsName string `json:"os_name"`
// 操作系统类型
OsType string `json:"os_type"`
// 系统管理员可见的安全组规则
AdminSecurityRules string `json:"admin_security_rules"`
// list
AttachTime time.Time `attach_time`
// common
IsPrepaidRecycle bool `json:"is_prepaid_recycle"`
// 备机所在宿主机名称
BackupHostName string `json:"backup_host_name"`
// 北京所在宿主机状态
BackupHostStatus string `json:"backup_host_status"`
// 宿主机名称
Host string `json:"host"`
// 宿主机SN
HostSN string `json:"host_sn"`
CanRecycle bool `json:"can_recycle"`
// 自动释放时间
AutoDeleteAt time.Time `json:"auto_delete_at"`
// 标签
Metadata map[string]string `json:"metadata"`
// 磁盘数量
DiskCount int `json:"disk_count"`
// 是否支持ISO启动
CdromSupport bool `json:"cdrom_support"`
}

View File

@@ -36,6 +36,7 @@ type GuesttemplateCreateInput struct {
}
type GuesttemplateDetails struct {
apis.Meta
apis.SharableVirtualResourceDetails
SGuestTemplate

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