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
3737 changed files with 190807 additions and 536716 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,20 +5,20 @@ 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:
command: |
make -j3 check
make check
build:
requires:
- check
docker:
- image: yunionio/centos-build:1.0-1
- image: yunionio/onecloud-ci:v1.0.2
environment:
ONECLOUD_CI_BUILD: "1"
@@ -26,24 +26,24 @@ 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)"
echo $targets | tr ' ' '\n'
make -j3 $targets
make $targets
ls -lh _output/bin/
- 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,17 +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
parallelism: 4
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: |
@@ -69,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

@@ -1,15 +1,9 @@
**这个 PR 实现什么功能/修复什么问题**:
<!--
- [ ] 功能、bugfix描述
- [ ] 冒烟测试
- [ ] 单元测试编写
-->
**是否需要 backport 到之前的 release 分支**:
<!--
如果不需要,填写 "NONE".
如果需要,就以下面 item 的格式写 release 分支名,并提交对应的 cherry-pick PR:
- release/3.1
- release/2.8.0
- release/2.6.0
-->

View File

@@ -29,47 +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 cmd/cloudid
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 region
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: registry.cn-beijing.aliyuncs.com/yunionio/region
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
registry: registry.cn-beijing.aliyuncs.com
snapshot: true
dockerfile: build/docker/Dockerfile.region
- name: Image host
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: registry.cn-beijing.aliyuncs.com/yunionio/host
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
registry: registry.cn-beijing.aliyuncs.com
snapshot: true
dockerfile: build/docker/Dockerfile.host
- name: Image host-deployer
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: registry.cn-beijing.aliyuncs.com/yunionio/host-deployer
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
registry: registry.cn-beijing.aliyuncs.com
snapshot: true
dockerfile: build/docker/Dockerfile.host-deployer
- name: Image baremetal-agent
uses: elgohr/Publish-Docker-Github-Action@master
@@ -91,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:
@@ -131,6 +91,16 @@ jobs:
snapshot: true
dockerfile: build/docker/Dockerfile.logger
- name: Image region
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: registry.cn-beijing.aliyuncs.com/yunionio/region
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
registry: registry.cn-beijing.aliyuncs.com
snapshot: true
dockerfile: build/docker/Dockerfile.region
- name: Image scheduler
uses: elgohr/Publish-Docker-Github-Action@master
with:
@@ -201,6 +171,26 @@ jobs:
snapshot: true
dockerfile: build/docker/Dockerfile.notify
- name: Image host
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: registry.cn-beijing.aliyuncs.com/yunionio/host
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
registry: registry.cn-beijing.aliyuncs.com
snapshot: true
dockerfile: build/docker/Dockerfile.host
- name: Image host-deployer
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: registry.cn-beijing.aliyuncs.com/yunionio/host-deployer
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
registry: registry.cn-beijing.aliyuncs.com
snapshot: true
dockerfile: build/docker/Dockerfile.host-deployer
- name: Image cloudevent
uses: elgohr/Publish-Docker-Github-Action@master
with:
@@ -211,16 +201,6 @@ jobs:
snapshot: true
dockerfile: build/docker/Dockerfile.cloudevent
- name: Image cloudid
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: registry.cn-beijing.aliyuncs.com/yunionio/cloudid
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
registry: registry.cn-beijing.aliyuncs.com
snapshot: true
dockerfile: build/docker/Dockerfile.cloudid
- name: Image devtool
uses: elgohr/Publish-Docker-Github-Action@master
with:
@@ -230,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

3
.gitignore vendored
View File

@@ -30,10 +30,7 @@ _output
/relay
/structargtest
.idea
.vscode
GPATH
GRTAGS
GTAGS
pkg/generated
*.orig

View File

@@ -10,7 +10,7 @@ BUILD_SCRIPT := $(ROOT_DIR)/build/build.sh
ifeq ($(ONECLOUD_CI_BUILD),)
GIT_COMMIT := $(shell git rev-parse --short HEAD)
GIT_BRANCH := $(shell git name-rev --name-only HEAD)
GIT_VERSION := $(shell git describe --always --tags --abbrev=14 $(GIT_COMMIT)^{commit})
GIT_VERSION := $(shell git describe --tags --abbrev=14 $(GIT_COMMIT)^{commit})
GIT_TREE_STATE := $(shell s=`git status --porcelain 2>/dev/null`; if [ -z "$$s" ]; then echo "clean"; else echo "dirty"; fi)
BUILD_DATE := $(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
else
@@ -51,7 +51,6 @@ ifdef LIBQEMUIO_PATH
X_CGO_LDFLAGS := ${CGO_LDFLAGS_ENV} -laio -lqemuio -lpthread -L ${LIBQEMUIO_PATH}/src
endif
export GOOS ?= linux
export GO111MODULE:=on
export CGO_CFLAGS = ${X_CGO_CFLAGS}
export CGO_LDFLAGS = ${X_CGO_LDFLAGS}
@@ -76,7 +75,7 @@ install: prepare_dir
gencopyright:
@bash scripts/gencopyright.sh pkg cmd
@sh scripts/gencopyright.sh pkg cmd
test:
@go test $(GO_BUILD_FLAGS) $(shell go list ./... | egrep -v 'host-image|hostimage')
@@ -163,15 +162,9 @@ goimports-check:
fi
.PHONY: goimports-check
vet-check:
./scripts/vet.sh gen
./scripts/vet.sh chk
.PHONY: vet-check
check: fmt-check
check: gendocgo-check
check: goimports-check
check: vet-check
.PHONY: check
@@ -194,82 +187,48 @@ dep:
@$(MAKE) mod
mod:
go get -d $(patsubst %,%@master,$(shell GO111MODULE=on go mod edit -print | sed -n -e 's|.*\(yunion.io/x/[a-z].*\) v.*|\1|p'))
go get $(patsubst %,%@master,$(shell GO111MODULE=on go mod edit -print | sed -n -e 's|.*\(yunion.io/x/[a-z].*\) v.*|\1|p'))
go mod tidy
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
@@ -297,15 +256,10 @@ gen-swagger: gen-swagger-check
$(ROOT_DIR)/scripts/codegen.py swagger-code
$(ROOT_DIR)/scripts/codegen.py swagger-yaml
swagger-serve-only:
swagger-serve: gen-swagger
$(ROOT_DIR)/scripts/codegen.py swagger-serve
swagger-serve: gen-model-api gen-swagger swagger-serve-only
swagger-site: gen-model-api gen-swagger
$(ROOT_DIR)/scripts/codegen.py swagger-site
.PHONY: gen-model-api-check gen-model-api gen-swagger-check gen-swagger swagger-serve swagger-site
.PHONY: gen-model-api-check gen-model-api gen-swagger-check gen-swagger swagger-serve
REGISTRY ?= "registry.cn-beijing.aliyuncs.com/yunionio"
VERSION ?= $(shell git describe --exact-match 2> /dev/null || \

View File

@@ -1,7 +1,7 @@
# Yunion OneCloud
[![CircleCI](https://circleci.com/gh/yunionio/onecloud.svg?style=svg)](https://circleci.com/gh/yunionio/onecloud)
[![Build Status](https://travis-ci.com/yunionio/onecloud.svg?branch=master)](https://travis-ci.com/yunionio/onecloud/branches)
[![Build Status](https://travis-ci.com/yunionio/onecloud.svg?branch=master)](https://travis-ci.org/yunionio/onecloud)
[![Go Report Card](https://goreportcard.com/badge/github.com/yunionio/onecloud)](https://goreportcard.com/report/github.com/yunionio/onecloud)
### [README in Chinese](./README-CN.md)
@@ -40,7 +40,7 @@ Please refers to [install & deployment](https://docs.yunion.io/docs/setup/) (cur
- [Yunion OneCloud Documents](https://docs.yunion.io/)
- [Swagger API](https://docs.yunion.cn/apiv2/)
- [Swagger API](https://docs.yunion.cn/api/)
## Architecture

View File

@@ -1 +0,0 @@
DESCRIPTION="Yunion CloudId"

View File

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

View File

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

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 +0,0 @@
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:v0.1
ADD ./_output/bin/cloudid /opt/yunion/bin/cloudid

View File

@@ -1,3 +1,3 @@
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base: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.2.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,4 +1,4 @@
FROM registry.cn-beijing.aliyuncs.com/yunionio/host-deployer-base:v0.0.3
FROM registry.cn-beijing.aliyuncs.com/yunionio/host-deployer-base:v0.0.2
MAINTAINER "Yaoqi Wan wanyaoqi@yunionyun.com"

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.10.4-0
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"

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
{{.os_type}} 镜像 {{.name}} 上传完成

View File

@@ -1,66 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<table style="width: 650px; margin-bottom: 20px;" border="0" cellpadding="0" cellspacing="0" align="center">
<tr style="height: 50px; background: #333; overflow: hidden;">
<td>
<table style="margin-left: 20px;">
<tr>
<td>
<img src="data:{{.login_logo_format}};base64,{{.login_logo}}" alt="" style="color: #fff; height: 32px; vertical-align: middle;">
</td>
</tr>
</table>
</td>
<td>
<table style="float: right;">
<tr>
<td style="padding-left: 20px; padding-right: 20px;">
<a href="" style="text-decoration: none; color: #20A0FF; font-size: 12px; display: none;">产品</a>
</td>
<td style="padding-left: 20px; padding-right: 20px;">
<a href="" style="text-decoration: none; color: #20A0FF; font-size: 12px; display: none;">解决方案</a>
</td>
<td style="padding-left: 20px; padding-right: 20px;">
<a href="" style="text-decoration: none; color: #20A0FF; font-size: 12px; display: none;">服务</a>
</td>
<td style="padding-left: 20px; padding-right: 20px;">
<a href="" style="text-decoration: none; color: #20A0FF; font-size: 12px; display: none;">帮助与文档</a>
</td>
<td style="padding-left: 20px; padding-right: 20px;">
<a href="" style="text-decoration: none; color: #20A0FF; font-size: 12px; display: none;">关于我们</a>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td style="width: 100%;" colspan="2">
<table style="padding: 20px 10px; width: 100%;">
<tr>
<td style="padding-bottom: 20px;">
尊敬的{{.name}},您好:
</td>
</tr>
<tr>
<td style="padding-bottom: 10px;">请点击下面的链接,完成用户邮箱的激活:</td>
</tr>
<tr>
<td style="padding-bottom: 30px;"><a href="{{.link}}">{{.link}}</a></td>
</tr>
</table>
</td>
</tr>
<tr style="width: 96%;">
<td colspan="2" style="border-top: 1px dashed #ccc; color: #333; font-size: 12px; padding-bottom: 10px; font-weight: 100;">*为了确保您的帐号安全该链接仅48小时内访问有效请勿直接回复此邮件。</td>
</tr>
<tr>
<td colspan="2" style="background: #333; text-align: right; padding-right: 20px; font-size: 12px; color: #fff; height: 50px;">版权所有 © {{.copyright}} 保留一切权利</td>
</tr>
</table>
</body>
</html>

View File

@@ -1 +0,0 @@
镜像 {{.name}} 上传完成

View File

@@ -1 +0,0 @@
Yunion Verify

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

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package entry
package main
import (
"context"
@@ -32,6 +32,9 @@ import (
"yunion.io/x/onecloud/cmd/climc/promputils"
"yunion.io/x/onecloud/cmd/climc/shell"
_ "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/pkg/mcclient"
)
@@ -45,7 +48,7 @@ type BaseOptions struct {
CertFile string `default:"$YUNION_CERT_FILE" help:"certificate file"`
KeyFile string `default:"$YUNION_KEY_FILE" help:"private key file"`
Completion string `default:"" help:"Generate climc auto complete script" choices:"bash|zsh"`
Completion string `default:"" help:"Generate climc auto complete script" choices:"bash"`
UseCachedToken bool `default:"$YUNION_USE_CACHED_TOKEN|false" help:"Use cached token"`
OsUsername string `default:"$OS_USERNAME" help:"Username, defaults to env[OS_USERNAME]"`
@@ -58,8 +61,6 @@ type BaseOptions struct {
OsAccessKey string `default:"$OS_ACCESS_KEY" help:"ak/sk access key, defaults to env[OS_ACCESS_KEY]"`
OsSecretKey string `default:"$OS_SECRET_KEY" help:"ak/s secret, defaults to env[OS_SECRET_KEY]"`
OsAuthToken string `default:"$OS_AUTH_TOKEN" help:"token authenticate, defaults to env[OS_AUTH_TOKEN]"`
OsAuthURL string `default:"$OS_AUTH_URL" help:"Defaults to env[OS_AUTH_URL]"`
OsRegionName string `default:"$OS_REGION_NAME" help:"Defaults to env[OS_REGION_NAME]"`
@@ -71,13 +72,9 @@ type BaseOptions struct {
}
func getSubcommandsParser() (*structarg.ArgumentParser, error) {
var (
prog = "climc"
desc = `Command-line interface to the API server.`
)
parse, e := structarg.NewArgumentParser(&BaseOptions{},
prog,
desc,
"climc",
`Command-line interface to the API server.`,
`See "climc help COMMAND" for help on a specific command.`)
if e != nil {
return nil, e
@@ -98,28 +95,26 @@ func getSubcommandsParser() (*structarg.ArgumentParser, error) {
return nil
}
})
promptRootCmd := promputils.InitRootCmd(prog, desc, parse.GetOptArgs(), parse.GetPosArgs())
for _, v := range shell.CommandTable {
_par, e := subcmd.AddSubParser(v.Options, v.Command, v.Desc, v.Callback)
if e != nil {
return nil, e
}
promputils.AppendCommand(promptRootCmd, v.Command, v.Desc)
promputils.AppendCommand(v.Command, v.Desc)
cmd := v.Command
for _, v := range _par.GetOptArgs() {
text := v.String()
text = strings.TrimLeft(text, "[<")
text = strings.TrimRight(text, "]>")
promputils.AppendOpt(cmd, text, v.HelpString(""), v)
promputils.AppendOpt(cmd, text, v.HelpString(""))
}
for _, v := range _par.GetPosArgs() {
text := v.String()
text = strings.TrimLeft(text, "[<")
text = strings.TrimRight(text, "]>")
promputils.AppendPos(cmd, text, v.HelpString(""), v)
promputils.AppendPos(cmd, text, v.HelpString(""))
}
}
return parse, nil
@@ -135,8 +130,8 @@ func newClientSession(options *BaseOptions) (*mcclient.ClientSession, error) {
if len(options.OsAuthURL) == 0 {
return nil, fmt.Errorf("Missing OS_AUTH_URL")
}
if len(options.OsUsername) == 0 && len(options.OsAccessKey) == 0 && len(options.OsAuthToken) == 0 {
return nil, fmt.Errorf("Missing OS_USERNAME or OS_ACCESS_KEY or OS_AUTH_TOKEN")
if len(options.OsUsername) == 0 && len(options.OsAccessKey) == 0 {
return nil, fmt.Errorf("Missing OS_USERNAME or OS_ACCESS_KEY")
}
if len(options.OsUsername) > 0 && len(options.OsPassword) == 0 {
return nil, fmt.Errorf("Missing OS_PASSWORD")
@@ -144,6 +139,9 @@ func newClientSession(options *BaseOptions) (*mcclient.ClientSession, error) {
if len(options.OsAccessKey) > 0 && len(options.OsSecretKey) == 0 {
return nil, fmt.Errorf("Missing OS_SECRET_KEY")
}
if len(options.OsRegionName) == 0 {
return nil, fmt.Errorf("Missing OS_REGION_NAME")
}
logLevel := "info"
if options.Debug {
@@ -186,11 +184,7 @@ func newClientSession(options *BaseOptions) (*mcclient.ClientSession, error) {
if cacheToken == nil {
var token mcclient.TokenCredential
var err error
if len(options.OsAuthToken) > 0 {
token, err = client.AuthenticateToken(options.OsAuthToken, options.OsProjectName,
options.OsProjectDomain,
mcclient.AuthSourceCli)
} else if len(options.OsAccessKey) > 0 {
if len(options.OsAccessKey) > 0 {
token, err = client.AuthenticateByAccessKey(options.OsAccessKey,
options.OsSecretKey, mcclient.AuthSourceCli)
} else {
@@ -266,7 +260,7 @@ func executeSubcommand(
}
}
func ClimcMain() {
func main() {
parser, e := getSubcommandsParser()
if e != nil {
showErrorAndExit(e)
@@ -275,7 +269,7 @@ func ClimcMain() {
options := parser.Options().(*BaseOptions)
if len(options.Completion) > 0 {
completeScript := promputils.GenerateAutoCompleteCmds(promputils.GetRootCmd(), options.Completion)
completeScript := promputils.GenerateAutoCompleteCmds(options.Completion)
if len(completeScript) > 0 {
fmt.Printf("%s", completeScript)
}

View File

@@ -1,42 +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 (
"yunion.io/x/onecloud/cmd/climc/entry"
_ "yunion.io/x/onecloud/cmd/climc/shell"
_ "yunion.io/x/onecloud/cmd/climc/shell/ansible"
_ "yunion.io/x/onecloud/cmd/climc/shell/cloudevent"
_ "yunion.io/x/onecloud/cmd/climc/shell/cloudid"
_ "yunion.io/x/onecloud/cmd/climc/shell/cloudnet"
_ "yunion.io/x/onecloud/cmd/climc/shell/compute"
_ "yunion.io/x/onecloud/cmd/climc/shell/etcd"
_ "yunion.io/x/onecloud/cmd/climc/shell/events"
_ "yunion.io/x/onecloud/cmd/climc/shell/identity"
_ "yunion.io/x/onecloud/cmd/climc/shell/image"
_ "yunion.io/x/onecloud/cmd/climc/shell/itsm"
_ "yunion.io/x/onecloud/cmd/climc/shell/k8s"
_ "yunion.io/x/onecloud/cmd/climc/shell/logger"
_ "yunion.io/x/onecloud/cmd/climc/shell/meter"
_ "yunion.io/x/onecloud/cmd/climc/shell/misc"
_ "yunion.io/x/onecloud/cmd/climc/shell/monitor"
_ "yunion.io/x/onecloud/cmd/climc/shell/notify"
_ "yunion.io/x/onecloud/cmd/climc/shell/servicetree"
_ "yunion.io/x/onecloud/cmd/climc/shell/yunionconf"
)
func main() {
entry.ClimcMain()
}

View File

@@ -1,178 +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 promputils
import (
"fmt"
"io"
"strings"
"text/template"
"yunion.io/x/structarg"
)
// ref: https://github.com/spf13/cobra/blob/master/zsh_completions.go
var (
zshCompFuncMap = template.FuncMap{
"genZshFuncName": zshCompGenFuncName,
"extractFlags": zshCompExtractFlag,
"genFlagEntryForZshArguments": zshCompGenFlagEntryForArguments,
"extractArgsCompletions": zshCompExtractArgumentCompletionHintsForRendering,
}
zshCompletionText = `
{{/* should accept Command (that contains subcommands) as parameter */}}
{{define "argumentsC" -}}
{{ $cmdPath := genZshFuncName .}}
function {{$cmdPath}} {
local -a commands
_arguments -C \{{- range extractFlags .}}
{{genFlagEntryForZshArguments .}} \{{- end}}
"1: :->cmnds" \
"*::arg:->args"
case $state in
cmnds)
commands=({{range .SubCmds}}
"{{.Name}}:{{.Desc}}"{{end}}
)
_describe "command" commands
;;
esac
case "$words[1]" in {{- range .SubCmds}}
{{.Name}})
{{$cmdPath}}_{{.Name}}
;;{{end}}
esac
}
{{range .SubCmds}}
{{template "selectCmdTemplate" .}}
{{- end}}
{{- end}}
{{/* should accept Command without subcommands as parameter */}}
{{define "arguments" -}}
function {{genZshFuncName .}} {
{{" _arguments"}}{{range extractFlags .}} \
{{genFlagEntryForZshArguments . -}}
{{end}}{{range extractArgsCompletions .}} \
{{.}}{{end}}
}
{{end}}
{{/* dispatcher for commands with or without subcommands */}}
{{define "selectCmdTemplate" -}}
{{if .SubCmds}}{{template "argumentsC" .}}{{else}}{{template "arguments" .}}{{end}}
{{- end}}
{{/* template entry point */}}
{{define "Main" -}}
#compdef _{{.Name}} {{.Name}}
{{template "selectCmdTemplate" .}}
compdef _{{.Name}} {{.Name}}
{{end}}
`
)
func zshCompGenFuncName(c *Cmd) string {
if c.ParentCmd != nil {
return zshCompGenFuncName(c.ParentCmd) + "_" + c.Name
}
return "_" + c.Name
}
func zshCompExtractFlag(c *Cmd) []structarg.Argument {
return c.GetArguments()
}
func zshCompGenFlagEntryForArguments(f structarg.Argument) string {
// not process positional argument and single command
if f.IsPositional() {
return ""
}
if f.ShortToken() == "" {
return zshCompGenFlagEntryForSingleOptionFlag(f)
}
return zshCompGenFlagEntryForMultiOptionFlag(f)
}
func zshCompGenFlagEntryForSingleOptionFlag(f structarg.Argument) string {
var option, multiMark, extras string
if f.IsMulti() {
multiMark = "*"
}
option = "--" + f.Token()
extras = zshCompGenFlagEntryExtras(f)
return fmt.Sprintf(`'%s%s[%s]%s'`, multiMark, option, zshCompQuoteFlagDescription(f.HelpString("")), extras)
}
func zshCompGenFlagEntryForMultiOptionFlag(f structarg.Argument) string {
var options, parenMultiMark, curlyMultiMark, extras string
if f.IsMulti() {
parenMultiMark = "*"
curlyMultiMark = "\\*"
}
options = fmt.Sprintf(`'(%s-%s %s--%s)'{%s-%s,%s--%s}`,
parenMultiMark, f.ShortToken(), parenMultiMark, f.Token(), curlyMultiMark, f.ShortToken(), curlyMultiMark, f.Token())
extras = zshCompGenFlagEntryExtras(f)
return fmt.Sprintf(`%s'[%s]%s'`, options, zshCompQuoteFlagDescription(f.HelpString("")), extras)
}
func zshCompGenFlagEntryExtras(f structarg.Argument) string {
if !f.NeedData() {
return ""
}
// allow options for flag
extras := ":"
type iChoices interface {
Choices() []string
}
if hasChoices, ok := f.(iChoices); ok {
// process choices
var words []string
for _, w := range hasChoices.Choices() {
words = append(words, fmt.Sprintf("%q", w))
}
if len(words) != 0 {
extras = fmt.Sprintf("%s :(%s)", extras, strings.Join(words, " "))
}
}
return extras
}
func zshCompQuoteFlagDescription(s string) string {
s = strings.Replace(s, "'", `'\''`, -1)
s = strings.Replace(s, "[", `\[`, -1)
s = strings.Replace(s, "]", `\]`, -1)
return s
}
func zshCompExtractArgumentCompletionHintsForRendering(c *Cmd) []string {
return nil
}
func (c *Cmd) GenZshCompletion(w io.Writer) error {
tmpl, err := template.New("Main").Funcs(zshCompFuncMap).Parse(zshCompletionText)
if err != nil {
return fmt.Errorf("error creating zsh completion template: %v", err)
}
return tmpl.Execute(w, c.Root())
}

View File

@@ -75,3 +75,33 @@ _climc(){
do
line="${arr[$i]}"
allopts[count]=${line%s`
const ZSH_COMPLETE_SCRIPT_2 = `%"#"*}
subopts[count]=${line#*"#"}
((count++))
done
_arguments \
'1: :->commands'\
'*: :->options'
case $state in
commands)
_arguments '1:Comm:(${allopts[*]})'
;;
*)
item=1
for key in ${allopts[*]}
do
case $words[2] in
$key)
compadd "$@"` + "`echo $subopts[item]`" + `
;;
*)
;;
esac
((item++))
done
esac
}
_climc "$@"
`

View File

@@ -15,118 +15,26 @@
package promputils
import (
"bytes"
"fmt"
"regexp"
"strings"
prompt "github.com/c-bata/go-prompt"
"yunion.io/x/structarg"
)
var (
subcmds = make(map[string]*Cmd)
rootCmd *Cmd
)
type Cmd struct {
desc string
optArgs []prompt.Suggest
posArgs []prompt.Suggest
}
var cmds = make(map[string]*Cmd)
var optionHelp = []prompt.Suggest{
{Text: "-h"},
{Text: "--help"},
}
type Cmd struct {
Name string
Desc string
optArgs []CmdArgument
posArgs []CmdArgument
ParentCmd *Cmd
SubCmds []*Cmd
}
func InitRootCmd(name, desc string, optArgs, posArgs []structarg.Argument) *Cmd {
rootCmd = NewCmd(name, desc)
for _, optA := range optArgs {
rootCmd.AddOptArgument(optA, optA.Token(), optA.HelpString(""))
}
for _, posA := range posArgs {
rootCmd.AddPosArgument(posA, posA.Token(), posA.HelpString(""))
}
return rootCmd
}
func GetRootCmd() *Cmd {
return rootCmd
}
func NewCmd(name, desc string) *Cmd {
return &Cmd{
Name: name,
Desc: desc,
optArgs: make([]CmdArgument, 0),
posArgs: make([]CmdArgument, 0),
SubCmds: make([]*Cmd, 0),
}
}
func (c Cmd) getPromptSuggests(args []CmdArgument) []prompt.Suggest {
ret := make([]prompt.Suggest, 0)
for _, arg := range args {
ret = append(ret, arg.Suggest)
}
return ret
}
func (c *Cmd) Root() *Cmd {
if c.ParentCmd == nil {
return c
}
return c.ParentCmd.Root()
}
func (c Cmd) GetName() string {
return c.Name
}
func (c *Cmd) AddCmd(cmd *Cmd) {
c.SubCmds = append(c.SubCmds, cmd)
}
func (c Cmd) GetPromptOptSuggests() []prompt.Suggest {
return c.getPromptSuggests(c.optArgs)
}
func (c Cmd) GetPromptPosSuggests() []prompt.Suggest {
return c.getPromptSuggests(c.posArgs)
}
func (c Cmd) GetOptArguments() []structarg.Argument {
return c.getArguments(c.optArgs)
}
func (c Cmd) GetArguments() []structarg.Argument {
ret := c.GetOptArguments()
ret = append(ret, c.GetPosArguments()...)
return ret
}
func (c Cmd) GetPosArguments() []structarg.Argument {
return c.getArguments(c.posArgs)
}
func (c Cmd) getArguments(args []CmdArgument) []structarg.Argument {
ret := make([]structarg.Argument, 0)
for _, a := range args {
ret = append(ret, a.Argument)
}
return ret
}
type CmdArgument struct {
Suggest prompt.Suggest
Argument structarg.Argument
}
func optionCompleter(args []string, long bool) []prompt.Suggest {
l := len(args)
if l == 0 {
@@ -139,11 +47,11 @@ func optionCompleter(args []string, long bool) []prompt.Suggest {
return optionHelp
}
if subcmds[args[0]] == nil {
if cmds[args[0]] == nil {
return []prompt.Suggest{}
}
_cmd := subcmds[args[0]].GetPromptOptSuggests()
_cmd := cmds[args[0]].optArgs
return prompt.FilterContains(_cmd, strings.TrimLeft(args[l-1], "-"), true)
}
@@ -192,7 +100,7 @@ func argumentsCompleter(args []string) []prompt.Suggest {
if len(args) == 1 {
return prompt.FilterHasPrefix(commands, args[0], true)
}
_cmd, ok := subcmds[args[0]]
_cmd, ok := cmds[args[0]]
if !ok {
return []prompt.Suggest{}
}
@@ -203,75 +111,48 @@ func argumentsCompleter(args []string) []prompt.Suggest {
prm := _cmd.posArgs[len(args)-2]
subcommands := []prompt.Suggest{
prm.Suggest,
prm,
}
return prompt.FilterHasPrefix(subcommands, args[len(args)-1], true)
}
func AppendCommand(parentCmd *Cmd, text, desc string) {
func AppendCommand(text, desc string) {
commands = append(commands, prompt.Suggest{Text: text, Description: desc})
cmd := &Cmd{
Name: text,
Desc: desc,
posArgs: make([]CmdArgument, 0),
optArgs: make([]CmdArgument, 0),
ParentCmd: parentCmd,
}
subcmds[text] = cmd
parentCmd.AddCmd(cmd)
cmds[text] = &Cmd{}
cmds[text].desc = desc
cmds[text].posArgs = []prompt.Suggest{}
cmds[text].optArgs = []prompt.Suggest{}
}
func (c *Cmd) addArgument(target *[]CmdArgument, arg structarg.Argument, argStr string, desc string) {
*target = append(*target, CmdArgument{
Suggest: prompt.Suggest{
Text: argStr,
Description: desc,
},
Argument: arg,
})
func AppendPos(text, cmd, desc string) {
var v = []prompt.Suggest{{Text: cmd, Description: desc}}
cmds[text].posArgs = append(cmds[text].posArgs, v...)
}
func (c *Cmd) AddPosArgument(arg structarg.Argument, argStr string, desc string) {
c.addArgument(&c.posArgs, arg, argStr, desc)
func AppendOpt(text, cmd, desc string) {
var v = []prompt.Suggest{{Text: cmd, Description: desc}}
cmds[text].optArgs = append(cmds[text].optArgs, v...)
}
func (c *Cmd) AddOptArgument(arg structarg.Argument, argStr string, desc string) {
c.addArgument(&c.optArgs, arg, argStr, desc)
}
func AppendPos(text, cmd, desc string, arg structarg.Argument) {
cmdObj := subcmds[text]
cmdObj.AddPosArgument(arg, cmd, desc)
}
func AppendOpt(text, cmd, desc string, arg structarg.Argument) {
cmdObj := subcmds[text]
cmdObj.AddOptArgument(arg, cmd, desc)
}
func GenerateAutoCompleteCmds(rootCmd *Cmd, shell string) string {
func GenerateAutoCompleteCmds(shell string) string {
var ret = []string{}
var i = 0
if strings.ToLower(shell) == "zsh" {
out := bytes.NewBufferString("")
if err := rootCmd.GenZshCompletion(out); err != nil {
panic(err)
}
return out.String()
i = 1
}
for _, cmd := range subcmds {
for cmd, options := range cmds {
var (
strPosArgs = []string{}
strOptArgs = []string{}
)
for _, posArg := range cmd.GetPromptPosSuggests() {
for _, posArg := range options.posArgs {
strPosArgs = append(strPosArgs, posArg.Text)
}
for _, optArg := range cmd.GetPromptOptSuggests() {
for _, optArg := range options.optArgs {
strOptArgs = append(strOptArgs, strings.Split(optArg.Text, " ")[0])
}
ret = append(ret, fmt.Sprintf(`arr[%d]="%s# %s %s"`, i, cmd.Name,
ret = append(ret, fmt.Sprintf(`arr[%d]="%s# %s %s"`, i, cmd,
strings.Join(strPosArgs, " "), strings.Join(strOptArgs, " ")))
i += 1
}

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package meter
package shell
import (
"yunion.io/x/jsonutils"

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package logger
package shell
import (
"fmt"

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package servicetree
package shell
import (
"yunion.io/x/jsonutils"

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package servicetree
package shell
import (
"fmt"

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package servicetree
package shell
import (
"yunion.io/x/jsonutils"

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package servicetree
package shell
import (
"strings"

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package ansible
package shell
import (
"fmt"

View File

@@ -1,32 +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 ansible
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
InvalidUpdateError = shell.InvalidUpdateError
printObjectRecursive = printutils.PrintJSONObjectRecursive
exportList = shell.ExportList
)

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package ansible
package shell
import (
"yunion.io/x/jsonutils"

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package ansible
package shell
import (
"yunion.io/x/onecloud/pkg/mcclient"
@@ -49,34 +49,4 @@ func init() {
printList(apbs, modules.AnsiblePlaybooksV2.GetColumns(s))
return nil
})
R(&AnsiblePlaybookV2IdOptions{}, "ansibleplaybookv2-run", "Run ansible playbook",
func(s *mcclient.ClientSession, opts *AnsiblePlaybookV2IdOptions) error {
apb, err := modules.AnsiblePlaybooksV2.PerformAction(s, opts.ID, "run", nil)
if err != nil {
return err
}
printObject(apb)
return nil
},
)
R(&AnsiblePlaybookV2IdOptions{}, "ansibleplaybookv2-stop", "Stop ansible playbook",
func(s *mcclient.ClientSession, opts *AnsiblePlaybookV2IdOptions) error {
apb, err := modules.AnsiblePlaybooksV2.PerformAction(s, opts.ID, "stop", nil)
if err != nil {
return err
}
printObject(apb)
return nil
},
)
R(&AnsiblePlaybookV2IdOptions{}, "ansibleplaybookv2-delete", "Delete ansible playbook",
func(s *mcclient.ClientSession, opts *AnsiblePlaybookV2IdOptions) error {
apb, err := modules.AnsiblePlaybooksV2.Delete(s, opts.ID, nil)
if err != nil {
return err
}
printObject(apb)
return nil
},
)
}

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package meter
package shell
import (
"yunion.io/x/onecloud/pkg/mcclient"

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package compute
package shell
import (
"yunion.io/x/jsonutils"

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package logger
package shell
import (
"yunion.io/x/jsonutils"

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package compute
package shell
import (
"yunion.io/x/jsonutils"

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package compute
package shell
import (
"yunion.io/x/jsonutils"

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package meter
package shell
import (
"yunion.io/x/jsonutils"

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package meter
package shell
import (
"yunion.io/x/jsonutils"

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package meter
package shell
import (
"yunion.io/x/jsonutils"

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package meter
package shell
import (
"yunion.io/x/jsonutils"

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package meter
package shell
import (
"yunion.io/x/jsonutils"

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package meter
package shell
import (
"yunion.io/x/jsonutils"

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package meter
package shell
import (
"yunion.io/x/jsonutils"

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package compute
package shell
import (
"fmt"
@@ -26,28 +26,18 @@ import (
"yunion.io/x/onecloud/pkg/mcclient/modulebase"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
"yunion.io/x/onecloud/pkg/multicloud/objectstore"
objectshell "yunion.io/x/onecloud/pkg/multicloud/objectstore"
)
func init() {
type BucketListOptions struct {
options.BaseListOptions
DistinctField string `help:"query specified distinct field"`
}
R(&BucketListOptions{}, "bucket-list", "List all buckets", func(s *mcclient.ClientSession, args *BucketListOptions) error {
params, err := options.ListStructToParams(args)
if err != nil {
return err
}
if len(args.DistinctField) > 0 {
params.Add(jsonutils.NewString(args.DistinctField), "extra_field")
result, err := modules.Buckets.Get(s, "distinct-field", params)
if err != nil {
return err
}
fmt.Println(result)
return nil
}
result, err := modules.Buckets.List(s, params)
if err != nil {
return err
@@ -56,10 +46,10 @@ func init() {
return nil
})
type BucketIdOptions struct {
type BucketShowOptions struct {
ID string `help:"ID or name of bucket"`
}
R(&BucketIdOptions{}, "bucket-show", "Id details of bucket", func(s *mcclient.ClientSession, args *BucketIdOptions) error {
R(&BucketShowOptions{}, "bucket-show", "Show details of bucket", func(s *mcclient.ClientSession, args *BucketShowOptions) error {
result, err := modules.Buckets.Get(s, args.ID, nil)
if err != nil {
return err
@@ -68,15 +58,6 @@ func init() {
return nil
})
R(&BucketIdOptions{}, "bucket-syncstatus", "Sync bucket statust", func(s *mcclient.ClientSession, args *BucketIdOptions) error {
result, err := modules.Buckets.PerformAction(s, args.ID, "syncstatus", nil)
if err != nil {
return err
}
printObject(result)
return nil
})
type BucketUpdateOptions struct {
ID string `help:"ID or name of bucket" json:"-"`
Name string `help:"new name of bucket" json:"name"`
@@ -188,7 +169,7 @@ func init() {
StorageClass string `help:"storage CLass"`
Acl string `help:"object acl." choices:"private|public-read|public-read-write"`
objectstore.ObjectHeaderOptions
objectshell.ObjectHeaderOptions
}
R(&BucketUploadObjectsOptions{}, "bucket-object-upload", "Upload an object into a bucket", func(s *mcclient.ClientSession, args *BucketUploadObjectsOptions) error {
var body io.Reader
@@ -325,7 +306,7 @@ func init() {
Key []string `help:"Optional object key" json:"key"`
objectstore.ObjectHeaderOptions
objectshell.ObjectHeaderOptions
}
R(&BucketSetMetadataOptions{}, "bucket-set-metadata", "Set metadata of object", func(s *mcclient.ClientSession, args *BucketSetMetadataOptions) error {
input := api.BucketMetadataInput{}

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package compute
package shell
import (
"yunion.io/x/onecloud/pkg/mcclient"

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package compute
package shell
import (
"yunion.io/x/onecloud/pkg/mcclient"

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package meter
package shell
import (
"yunion.io/x/jsonutils"

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package compute
package shell
import (
"fmt"
@@ -26,36 +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"`
DistinctField string `help:"distinct field"`
ProxySetting string `help:"Proxy setting id or name"`
}
R(&CloudaccountListOptions{}, "cloud-account-list", "List cloud accounts", func(s *mcclient.ClientSession, args *CloudaccountListOptions) error {
var params *jsonutils.JSONDict
@@ -65,21 +39,6 @@ func init() {
if err != nil {
return err
}
if len(args.Capability) > 0 {
params.Add(jsonutils.NewStringArray(args.Capability), "capability")
}
if len(args.ProxySetting) > 0 {
params.Add(jsonutils.NewString(args.ProxySetting), "proxy_setting")
}
}
if len(args.DistinctField) > 0 {
params.Add(jsonutils.NewString(args.DistinctField), "extra_field")
result, err := modules.Cloudaccounts.Get(s, "distinct-field", params)
if err != nil {
return err
}
fmt.Println(result)
return nil
}
result, err := modules.Cloudaccounts.List(s, params)
if err != nil {
@@ -125,22 +84,6 @@ func init() {
printObject(result)
return nil
})
type SVMwareCloudAccountPrepareNetsOptions struct {
Project string `help:"project for this account"`
ProjectDomain string `help:"domain for this account"`
NAME string `help:"name for this account"`
options.SVMwareCredentialWithEnvironment
}
R(&SVMwareCloudAccountPrepareNetsOptions{}, "cloud-account-preparenets-vmware", "Prepare networks for a VMware cloud account before create this accout", func(s *mcclient.ClientSession, args *SVMwareCloudAccountPrepareNetsOptions) error {
params := jsonutils.Marshal(args)
params.(*jsonutils.JSONDict).Add(jsonutils.NewString("VMware"), "provider")
result, err := modules.Cloudaccounts.PerformClassAction(s, "prepare-nets", params)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&options.SAliyunCloudAccountCreateOptions{}, "cloud-account-create-aliyun", "Create an Aliyun cloud account", func(s *mcclient.ClientSession, args *options.SAliyunCloudAccountCreateOptions) error {
params := jsonutils.Marshal(args)
@@ -191,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
}
@@ -430,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)
@@ -484,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()
@@ -736,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)
@@ -769,129 +690,6 @@ func init() {
return nil
})
R(&options.SVMwareCloudAccountUpdateCredentialOptions{}, "cloud-account-test-connectivity-vmware", "Update credential of a VMware cloud account", func(s *mcclient.ClientSession, args *options.SVMwareCloudAccountUpdateCredentialOptions) error {
params := jsonutils.Marshal(args)
result, err := modules.Cloudaccounts.PerformAction(s, args.ID, "test-connectivity", params)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&options.SAliyunCloudAccountUpdateCredentialOptions{}, "cloud-account-test-connectivity-aliyun", "Update credential of an Aliyun cloud account", func(s *mcclient.ClientSession, args *options.SAliyunCloudAccountUpdateCredentialOptions) error {
params := jsonutils.Marshal(args)
result, err := modules.Cloudaccounts.PerformAction(s, args.ID, "test-connectivity", params)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&options.SAzureCloudAccountUpdateCredentialOptions{}, "cloud-account-test-connectivity-azure", "Update credential of an Azure cloud account", func(s *mcclient.ClientSession, args *options.SAzureCloudAccountUpdateCredentialOptions) error {
params := jsonutils.Marshal(args)
result, err := modules.Cloudaccounts.PerformAction(s, args.ID, "test-connectivity", params)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&options.SQcloudCloudAccountUpdateCredentialOptions{}, "cloud-account-test-connectivity-qcloud", "Update credential of a Qcloud cloud account", func(s *mcclient.ClientSession, args *options.SQcloudCloudAccountUpdateCredentialOptions) error {
params := jsonutils.Marshal(args)
result, err := modules.Cloudaccounts.PerformAction(s, args.ID, "test-connectivity", params)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&options.SAWSCloudAccountUpdateCredentialOptions{}, "cloud-account-test-connectivity-aws", "Update credential of an AWS cloud account", func(s *mcclient.ClientSession, args *options.SAWSCloudAccountUpdateCredentialOptions) error {
params := jsonutils.Marshal(args)
result, err := modules.Cloudaccounts.PerformAction(s, args.ID, "test-connectivity", params)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&options.SOpenStackCloudAccountUpdateCredentialOptions{}, "cloud-account-test-connectivity-openstack", "Update credential of an OpenStack cloud account", func(s *mcclient.ClientSession, args *options.SOpenStackCloudAccountUpdateCredentialOptions) error {
params := jsonutils.Marshal(args)
result, err := modules.Cloudaccounts.PerformAction(s, args.ID, "test-connectivity", params)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&options.SHuaweiCloudAccountUpdateCredentialOptions{}, "cloud-account-test-connectivity-huawei", "Update credential of an Huawei cloud account", func(s *mcclient.ClientSession, args *options.SHuaweiCloudAccountUpdateCredentialOptions) error {
params := jsonutils.Marshal(args)
result, err := modules.Cloudaccounts.PerformAction(s, args.ID, "test-connectivity", params)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&options.SUcloudCloudAccountUpdateCredentialOptions{}, "cloud-account-test-connectivity-ucloud", "Update credential of a Ucloud cloud account", func(s *mcclient.ClientSession, args *options.SUcloudCloudAccountUpdateCredentialOptions) error {
params := jsonutils.Marshal(args)
result, err := modules.Cloudaccounts.PerformAction(s, args.ID, "test-connectivity", params)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&options.SZStackCloudAccountUpdateCredentialOptions{}, "cloud-account-test-connectivity-zstack", "Update credential of a ZStack cloud account", func(s *mcclient.ClientSession, args *options.SZStackCloudAccountUpdateCredentialOptions) error {
params := jsonutils.Marshal(args)
result, err := modules.Cloudaccounts.PerformAction(s, args.ID, "test-connectivity", params)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&options.SGoogleCloudAccountUpdateCredentialOptions{}, "cloud-account-test-connectivity-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, "test-connectivity", params)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&options.SS3CloudAccountUpdateCredentialOptions{}, "cloud-account-test-connectivity-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, "test-connectivity", params)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&options.SCtyunCloudAccountUpdateCredentialOptions{}, "cloud-account-test-connectivity-ctyun", "Update credential of an Ctyun cloud account", func(s *mcclient.ClientSession, args *options.SCtyunCloudAccountUpdateCredentialOptions) error {
params := jsonutils.Marshal(args)
result, err := modules.Cloudaccounts.PerformAction(s, args.ID, "test-connectivity", params)
if err != nil {
return err
}
printObject(result)
return nil
})
type CloudaccountSyncOptions struct {
ID string `help:"ID or Name of cloud account"`
Force bool `help:"Force sync no matter what"`
@@ -955,14 +753,10 @@ func init() {
})
type CloudaccountPublicOptions struct {
ID string `help:"ID or name of cloud account" json:"-"`
Scope string `help:"public_sccope" choices:"domain|system" json:"scope"`
SharedDomains []string `help:"shared domains" json:"shared_domains"`
ShareMode string `help:"share_mode" choices:"account_domain|provider_domain|system"`
ID string `help:"ID or name of cloud account"`
}
R(&CloudaccountPublicOptions{}, "cloud-account-public", "Mark this cloud account public ", func(s *mcclient.ClientSession, args *CloudaccountPublicOptions) error {
params := jsonutils.Marshal(args)
result, err := modules.Cloudaccounts.PerformAction(s, args.ID, "public", params)
result, err := modules.Cloudaccounts.PerformAction(s, args.ID, "public", nil)
if err != nil {
return err
}
@@ -1022,47 +816,4 @@ func init() {
printObject(result)
return nil
})
type ClouaccountChangeOwnerOptions struct {
ID string `help:"ID or name of cloudaccount" json:"-"`
ProjectDomain string `json:"project_domain" help:"target domain"`
}
R(&ClouaccountChangeOwnerOptions{}, "cloud-account-change-owner", "Change owner domain of cloudaccount", func(s *mcclient.ClientSession, args *ClouaccountChangeOwnerOptions) error {
if len(args.ProjectDomain) == 0 {
return fmt.Errorf("empty project_domain")
}
params := jsonutils.Marshal(args)
ret, err := modules.Cloudaccounts.PerformAction(s, args.ID, "change-owner", params)
if err != nil {
return err
}
printObject(ret)
return nil
})
type ClouaccountChangeProjectOptions struct {
ID string `help:"ID or name of cloudaccount" json:"-"`
PROJECT string `json:"project" help:"target domain"`
}
R(&ClouaccountChangeProjectOptions{}, "cloud-account-change-project", "Change domain/project of cloudaccount", func(s *mcclient.ClientSession, args *ClouaccountChangeProjectOptions) error {
if len(args.PROJECT) == 0 {
return fmt.Errorf("empty project")
}
params := jsonutils.Marshal(args)
ret, err := modules.Cloudaccounts.PerformAction(s, args.ID, "change-project", params)
if err != nil {
return err
}
printObject(ret)
return nil
})
R(&CloudaccountShowOptions{}, "cloud-account-change-owner-candidate-domains", "Show candiate domains of a cloud account changing project", func(s *mcclient.ClientSession, args *CloudaccountShowOptions) error {
result, err := modules.Cloudaccounts.GetSpecific(s, args.ID, "change-owner-candidate-domains", nil)
if err != nil {
return err
}
printObject(result)
return nil
})
}

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 cloudevent
import (
"yunion.io/x/onecloud/cmd/climc/shell"
"yunion.io/x/onecloud/pkg/util/printutils"
)
var (
R = shell.R
printList = printutils.PrintJSONList
)

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package cloudevent
package shell
import (
"yunion.io/x/onecloud/pkg/mcclient"

View File

@@ -1,168 +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 cloudid
import (
"yunion.io/x/jsonutils"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func init() {
type CloudgroupListOptions struct {
options.BaseListOptions
ClouduserId string `json:"clouduser_id"`
CloudpolicyId string `json:"cloudpolicy_id"`
Usable bool `json:"usable"`
}
R(&CloudgroupListOptions{}, "cloud-group-list", "List cloud groups", func(s *mcclient.ClientSession, opts *CloudgroupListOptions) error {
params, err := options.ListStructToParams(opts)
if err != nil {
return err
}
result, err := modules.Cloudgroups.List(s, params)
if err != nil {
return err
}
printList(result, modules.Cloudgroups.GetColumns(s))
return nil
})
type CloudgroupCreateOptions struct {
NAME string `json:"name"`
PROVIDER string `json:"provider" choices:"Google|Aliyun|Aws|Huawei|Qcloud"`
CloudpolicyIds []string `json:"cloudpolicy_ids"`
Desc string `json:"description"`
}
R(&CloudgroupCreateOptions{}, "cloud-group-create", "Create cloud group", func(s *mcclient.ClientSession, opts *CloudgroupCreateOptions) error {
params := jsonutils.Marshal(opts)
result, err := modules.Cloudgroups.Create(s, params)
if err != nil {
return err
}
printObject(result)
return nil
})
type CloudgroupIdOptions struct {
ID string `help:"Cloudgroup Id"`
}
R(&CloudgroupIdOptions{}, "cloud-group-delete", "Delete cloud group", func(s *mcclient.ClientSession, opts *CloudgroupIdOptions) error {
result, err := modules.Cloudgroups.Delete(s, opts.ID, nil)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&CloudgroupIdOptions{}, "cloud-group-show", "Show cloud group", func(s *mcclient.ClientSession, opts *CloudgroupIdOptions) error {
result, err := modules.Cloudgroups.Get(s, opts.ID, nil)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&CloudgroupIdOptions{}, "cloud-group-syncstatus", "Sync cloud group status", func(s *mcclient.ClientSession, opts *CloudgroupIdOptions) error {
result, err := modules.Cloudgroups.PerformAction(s, opts.ID, "syncstatus", nil)
if err != nil {
return err
}
printObject(result)
return nil
})
type CloudgroupPolicyOptions struct {
ID string `help:"Cloudgroup Id"`
CLOUDPOLICY_ID string `help:"Cloudpolicy Id"`
}
R(&CloudgroupPolicyOptions{}, "cloud-group-attach-policy", "Attach policy for cloud group", func(s *mcclient.ClientSession, opts *CloudgroupPolicyOptions) error {
result, err := modules.Cloudgroups.PerformAction(s, opts.ID, "attach-policy", jsonutils.Marshal(opts))
if err != nil {
return err
}
printObject(result)
return nil
})
R(&CloudgroupPolicyOptions{}, "cloud-group-detach-policy", "Detach policy from cloud group", func(s *mcclient.ClientSession, opts *CloudgroupPolicyOptions) error {
result, err := modules.Cloudgroups.PerformAction(s, opts.ID, "detach-policy", jsonutils.Marshal(opts))
if err != nil {
return err
}
printObject(result)
return nil
})
type CloudgroupUserOptions struct {
ID string `help:"Cloudgroup Id"`
CLOUDUSER_ID string `help:"Clouduser Id"`
}
R(&CloudgroupUserOptions{}, "cloud-group-add-user", "Add user to cloud group", func(s *mcclient.ClientSession, opts *CloudgroupUserOptions) error {
result, err := modules.Cloudgroups.PerformAction(s, opts.ID, "add-user", jsonutils.Marshal(opts))
if err != nil {
return err
}
printObject(result)
return nil
})
R(&CloudgroupUserOptions{}, "cloud-group-remove-user", "Remove user from cloud group", func(s *mcclient.ClientSession, opts *CloudgroupUserOptions) error {
result, err := modules.Cloudgroups.PerformAction(s, opts.ID, "remove-user", jsonutils.Marshal(opts))
if err != nil {
return err
}
printObject(result)
return nil
})
type CloudgroupPoliciesOptions struct {
ID string `help:"Cloudgroup Id"`
CloudpolicyIds []string `json:"cloudpolicy_ids"`
}
R(&CloudgroupPoliciesOptions{}, "cloud-group-set-policies", "Set cloudpolicies for cloud group", func(s *mcclient.ClientSession, opts *CloudgroupPoliciesOptions) error {
result, err := modules.Cloudgroups.PerformAction(s, opts.ID, "set-policies", jsonutils.Marshal(opts))
if err != nil {
return err
}
printObject(result)
return nil
})
type CloudgroupUsersOptions struct {
ID string `help:"Cloudgroup Id"`
ClouduserIds []string `json:"clouduser_ids"`
}
R(&CloudgroupUsersOptions{}, "cloud-group-set-users", "Set users for cloud group", func(s *mcclient.ClientSession, opts *CloudgroupUsersOptions) error {
result, err := modules.Cloudgroups.PerformAction(s, opts.ID, "set-users", jsonutils.Marshal(opts))
if err != nil {
return err
}
printObject(result)
return nil
})
}

View File

@@ -1,73 +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 cloudid
import (
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func init() {
type CloudgroupcacheListOptions struct {
options.BaseListOptions
CloudgroupId string `json:"cloudgroup_id"`
}
R(&CloudgroupcacheListOptions{}, "cloud-group-cache-list", "List cloud group caches", func(s *mcclient.ClientSession, opts *CloudgroupcacheListOptions) error {
params, err := options.ListStructToParams(opts)
if err != nil {
return err
}
result, err := modules.Cloudgroupcaches.List(s, params)
if err != nil {
return err
}
printList(result, modules.Cloudgroupcaches.GetColumns(s))
return nil
})
type CloudgroupcacheIdOption struct {
ID string `help:"Cloudgroup Id"`
}
R(&CloudgroupcacheIdOption{}, "cloud-group-cache-show", "Show cloud groupcache details", func(s *mcclient.ClientSession, opts *CloudgroupcacheIdOption) error {
result, err := modules.Cloudgroupcaches.Get(s, opts.ID, nil)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&CloudgroupcacheIdOption{}, "cloud-group-cache-syncstatus", "Sync cloudgroupcache", func(s *mcclient.ClientSession, opts *CloudgroupcacheIdOption) error {
result, err := modules.Cloudgroupcaches.PerformAction(s, opts.ID, "syncstatus", nil)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&CloudgroupcacheIdOption{}, "cloud-group-cache-delete", "Delete cloudgroupcache", func(s *mcclient.ClientSession, opts *CloudgroupcacheIdOption) error {
result, err := modules.Cloudgroupcaches.Delete(s, opts.ID, nil)
if err != nil {
return err
}
printObject(result)
return nil
})
}

View File

@@ -1,72 +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 cloudid
import (
"yunion.io/x/jsonutils"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modulebase"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func init() {
type CloudgroupPolicyListOptions struct {
options.BaseListOptions
Cloudgroup string `help:"ID or Name of Cloudgroup"`
Cloudpolicy string `help:"Policy ID or name"`
}
R(&CloudgroupPolicyListOptions{}, "cloud-group-policy-list", "List cloudgroup cloudpolicy pairs", func(s *mcclient.ClientSession, args *CloudgroupPolicyListOptions) error {
var params *jsonutils.JSONDict
{
var err error
params, err = args.BaseListOptions.Params()
if err != nil {
return err
}
}
var result *modulebase.ListResult
var err error
if len(args.Cloudgroup) > 0 {
result, err = modules.Cloudgrouppolicies.ListDescendent(s, args.Cloudgroup, params)
} else if len(args.Cloudpolicy) > 0 {
result, err = modules.Cloudgrouppolicies.ListDescendent2(s, args.Cloudpolicy, params)
} else {
result, err = modules.Cloudgrouppolicies.List(s, params)
}
if err != nil {
return err
}
printList(result, modules.Cloudgrouppolicies.GetColumns(s))
return nil
})
type CloudgroupPolicyDetailOptions struct {
CLOUDUSER string `help:"ID or Name of Cloudgroup"`
CLOUDPOLICY string `help:"ID or Name of Cloudpolicy"`
}
R(&CloudgroupPolicyDetailOptions{}, "cloud-group-policy-show", "Show cloudgrouppolicy details", func(s *mcclient.ClientSession, args *CloudgroupPolicyDetailOptions) error {
query := jsonutils.NewDict()
result, err := modules.Cloudgrouppolicies.Get(s, args.CLOUDUSER, args.CLOUDPOLICY, query)
if err != nil {
return err
}
printObject(result)
return nil
})
}

View File

@@ -1,72 +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 cloudid
import (
"yunion.io/x/jsonutils"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modulebase"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func init() {
type CloudgroupUserListOptions struct {
options.BaseListOptions
Cloudgroup string `help:"ID or Name of Cloudgroup"`
Clouduser string `help:"User ID or name"`
}
R(&CloudgroupUserListOptions{}, "cloud-group-user-list", "List cloudgroup clouduser pairs", func(s *mcclient.ClientSession, args *CloudgroupUserListOptions) error {
var params *jsonutils.JSONDict
{
var err error
params, err = args.BaseListOptions.Params()
if err != nil {
return err
}
}
var result *modulebase.ListResult
var err error
if len(args.Cloudgroup) > 0 {
result, err = modules.Cloudgroupusers.ListDescendent(s, args.Cloudgroup, params)
} else if len(args.Clouduser) > 0 {
result, err = modules.Cloudgroupusers.ListDescendent2(s, args.Clouduser, params)
} else {
result, err = modules.Cloudgroupusers.List(s, params)
}
if err != nil {
return err
}
printList(result, modules.Cloudgroupusers.GetColumns(s))
return nil
})
type CloudgroupUserDetailOptions struct {
CLOUDUSER string `help:"ID or Name of Cloudgroup"`
CLOUDPOLICY string `help:"ID or Name of Clouduser"`
}
R(&CloudgroupUserDetailOptions{}, "cloud-group-user-show", "Show cloudgroupuser details", func(s *mcclient.ClientSession, args *CloudgroupUserDetailOptions) error {
query := jsonutils.NewDict()
result, err := modules.Cloudgroupusers.Get(s, args.CLOUDUSER, args.CLOUDPOLICY, query)
if err != nil {
return err
}
printObject(result)
return nil
})
}

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 cloudid
import (
"yunion.io/x/jsonutils"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func init() {
type CloudpolicyListOptions struct {
options.BaseListOptions
ClouduserId string `json:"clouduser_id"`
CloudgroupId string `json:"cloudgroup_id"`
}
R(&CloudpolicyListOptions{}, "cloud-policy-list", "List cloud policies", func(s *mcclient.ClientSession, opts *CloudpolicyListOptions) error {
params, err := options.ListStructToParams(opts)
if err != nil {
return err
}
result, err := modules.Cloudpolicies.List(s, params)
if err != nil {
return err
}
printList(result, modules.Cloudpolicies.GetColumns(s))
return nil
})
type CloudpolicyIdOptions struct {
ID string `help:"Cloudpolicy Id"`
}
R(&CloudpolicyIdOptions{}, "cloud-policy-show", "Sow cloud policiy details", func(s *mcclient.ClientSession, opts *CloudpolicyIdOptions) error {
result, err := modules.Cloudpolicies.Get(s, opts.ID, nil)
if err != nil {
return err
}
printObject(result)
return nil
})
type CloudpolicyGroupOptions struct {
ID string `help:"Cloudpolicy Id"`
CLOUDGROUP_ID string `help:"Cloudgroup Id" json:"cloudgroup_id"`
}
R(&CloudpolicyGroupOptions{}, "cloud-policy-assign-group", "Assign cloud policiy to group", func(s *mcclient.ClientSession, opts *CloudpolicyGroupOptions) error {
result, err := modules.Cloudpolicies.PerformAction(s, opts.ID, "assign-group", jsonutils.Marshal(opts))
if err != nil {
return err
}
printObject(result)
return nil
})
R(&CloudpolicyGroupOptions{}, "cloud-policy-revoke-group", "Revoke cloud policiy from group", func(s *mcclient.ClientSession, opts *CloudpolicyGroupOptions) error {
result, err := modules.Cloudpolicies.PerformAction(s, opts.ID, "revoke-group", jsonutils.Marshal(opts))
if err != nil {
return err
}
printObject(result)
return nil
})
}

View File

@@ -1,72 +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 cloudid
import (
"yunion.io/x/jsonutils"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modulebase"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func init() {
type ClouduserPolicyListOptions struct {
options.BaseListOptions
Clouduser string `help:"ID or Name of Clouduser"`
Cloudpolicy string `help:"Policy ID or name"`
}
R(&ClouduserPolicyListOptions{}, "cloud-user-policy-list", "List clouduser cloudpolicy pairs", func(s *mcclient.ClientSession, args *ClouduserPolicyListOptions) error {
var params *jsonutils.JSONDict
{
var err error
params, err = args.BaseListOptions.Params()
if err != nil {
return err
}
}
var result *modulebase.ListResult
var err error
if len(args.Clouduser) > 0 {
result, err = modules.Clouduserpolicies.ListDescendent(s, args.Clouduser, params)
} else if len(args.Cloudpolicy) > 0 {
result, err = modules.Clouduserpolicies.ListDescendent2(s, args.Cloudpolicy, params)
} else {
result, err = modules.Clouduserpolicies.List(s, params)
}
if err != nil {
return err
}
printList(result, modules.Clouduserpolicies.GetColumns(s))
return nil
})
type ClouduserPolicyDetailOptions struct {
CLOUDUSER string `help:"ID or Name of Clouduser"`
CLOUDPOLICY string `help:"ID or Name of Cloudpolicy"`
}
R(&ClouduserPolicyDetailOptions{}, "cloud-user-policy-show", "Show clouduserpolicy details", func(s *mcclient.ClientSession, args *ClouduserPolicyDetailOptions) error {
query := jsonutils.NewDict()
result, err := modules.Clouduserpolicies.Get(s, args.CLOUDUSER, args.CLOUDPOLICY, query)
if err != nil {
return err
}
printObject(result)
return nil
})
}

View File

@@ -1,197 +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 cloudid
import (
"yunion.io/x/jsonutils"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func init() {
type ClouduserListOptions struct {
options.BaseListOptions
CloudaccountId string `help:"Cloudaccount Id"`
CloudproviderId string `help:"Cloudprovider Id"`
CloudpolicyId string `help:"filter cloudusers by cloudpolicy"`
CloudgroupId string `help:"filter cloudusers by cloudgroup"`
}
R(&ClouduserListOptions{}, "cloud-user-list", "List cloud users", func(s *mcclient.ClientSession, opts *ClouduserListOptions) error {
params, err := options.ListStructToParams(opts)
if err != nil {
return err
}
result, err := modules.Cloudusers.List(s, params)
if err != nil {
return err
}
printList(result, modules.Cloudusers.GetColumns(s))
return nil
})
type ClouduserCreateOptions struct {
Name string
CloudaccountId string `help:"Cloudaccount Id"`
CloudproviderId string `help:"Cloudprovider Id"`
OwnerId string `help:"Owner Id"`
CloudpolicyIds []string `help:"cloudpolicy ids"`
CloudgroupIds []string `help:"cloudgroup ids"`
Email string `help:"email address"`
MobilePhone string `help:"phone number"`
IsConsoleLogin *bool `help:"is console login"`
Password string `help:"clouduser password"`
}
R(&ClouduserCreateOptions{}, "cloud-user-create", "Create cloud user", func(s *mcclient.ClientSession, opts *ClouduserCreateOptions) error {
params := jsonutils.Marshal(opts)
result, err := modules.Cloudusers.Create(s, params)
if err != nil {
return err
}
printObject(result)
return nil
})
type ClouduserIdOptions struct {
ID string `help:"Clouduser Id"`
}
R(&ClouduserIdOptions{}, "cloud-user-delete", "Delete cloud user", func(s *mcclient.ClientSession, opts *ClouduserIdOptions) error {
result, err := modules.Cloudusers.Delete(s, opts.ID, nil)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&ClouduserIdOptions{}, "cloud-user-logininfo", "Show cloud user login info", func(s *mcclient.ClientSession, opts *ClouduserIdOptions) error {
result, err := modules.Cloudusers.GetLoginInfo(s, opts.ID, nil)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&ClouduserIdOptions{}, "cloud-user-show", "Show cloud user", func(s *mcclient.ClientSession, opts *ClouduserIdOptions) error {
result, err := modules.Cloudusers.Get(s, opts.ID, nil)
if err != nil {
return err
}
printObject(result)
return nil
})
type ClouduserSyncOptions struct {
ID string `help:"Clouduser Id"`
PolicyOnly bool `help:"Ony sync clouduser policies for cloud"`
}
R(&ClouduserSyncOptions{}, "cloud-user-sync", "Sync cloud user policies", func(s *mcclient.ClientSession, opts *ClouduserSyncOptions) error {
result, err := modules.Cloudusers.PerformAction(s, opts.ID, "sync", jsonutils.Marshal(opts))
if err != nil {
return err
}
printObject(result)
return nil
})
R(&ClouduserIdOptions{}, "cloud-user-syncstatus", "Sync cloud user status", func(s *mcclient.ClientSession, opts *ClouduserIdOptions) error {
result, err := modules.Cloudusers.PerformAction(s, opts.ID, "syncstatus", nil)
if err != nil {
return err
}
printObject(result)
return nil
})
type ClouduserPolicyOptions struct {
ID string `help:"Clouduser Id"`
CLOUDPOLICY_ID string `help:"cloudpolicy Id"`
}
R(&ClouduserPolicyOptions{}, "cloud-user-attach-policy", "Attach policy for cloud user", func(s *mcclient.ClientSession, opts *ClouduserPolicyOptions) error {
result, err := modules.Cloudusers.PerformAction(s, opts.ID, "attach-policy", jsonutils.Marshal(opts))
if err != nil {
return err
}
printObject(result)
return nil
})
R(&ClouduserPolicyOptions{}, "cloud-user-detach-policy", "Detach policy from cloud user", func(s *mcclient.ClientSession, opts *ClouduserPolicyOptions) error {
result, err := modules.Cloudusers.PerformAction(s, opts.ID, "detach-policy", jsonutils.Marshal(opts))
if err != nil {
return err
}
printObject(result)
return nil
})
type ClouduserPasswordOptions struct {
ID string `help:"Clouduser Id"`
Password string `help:"clouduser password"`
}
R(&ClouduserPasswordOptions{}, "cloud-user-reset-password", "Reset clouduser password", func(s *mcclient.ClientSession, opts *ClouduserPasswordOptions) error {
result, err := modules.Cloudusers.PerformAction(s, opts.ID, "reset-password", jsonutils.Marshal(opts))
if err != nil {
return err
}
printObject(result)
return nil
})
type ClouduserChangeOwnerOptions struct {
ID string `help:"clouduser id"`
USER_ID string `help:"local user id"`
}
R(&ClouduserChangeOwnerOptions{}, "cloud-user-change-owner", "Change clouduser owner", func(s *mcclient.ClientSession, opts *ClouduserChangeOwnerOptions) error {
result, err := modules.Cloudusers.PerformAction(s, opts.ID, "change-owner", jsonutils.Marshal(opts))
if err != nil {
return err
}
printObject(result)
return nil
})
type ClouduserGroupOptions struct {
ID string `help:"clouduser id"`
CLOUDGROUP_ID string `help:"cloudgroup id" json:"cloudgroup_id"`
}
R(&ClouduserGroupOptions{}, "cloud-user-join-group", "Join user to cloudgroup", func(s *mcclient.ClientSession, opts *ClouduserGroupOptions) error {
result, err := modules.Cloudusers.PerformAction(s, opts.ID, "join-group", jsonutils.Marshal(opts))
if err != nil {
return err
}
printObject(result)
return nil
})
R(&ClouduserGroupOptions{}, "cloud-user-leave-group", "Leave from cloudgroup", func(s *mcclient.ClientSession, opts *ClouduserGroupOptions) error {
result, err := modules.Cloudusers.PerformAction(s, opts.ID, "leave-group", jsonutils.Marshal(opts))
if err != nil {
return err
}
printObject(result)
return nil
})
}

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 cloudid
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
)

View File

@@ -15,19 +15,16 @@
package shell
import (
"yunion.io/x/onecloud/pkg/multicloud/zstack"
"yunion.io/x/onecloud/pkg/util/shellutils"
"yunion.io/x/onecloud/pkg/mcclient"
)
func init() {
type QuotaListOptions struct {
type CloudmetaOptions struct {
PROVIDER_ID string `help:"provider_id"`
REGION_ID string `help:"region_id"`
ZONE_ID string `help:"zone_id"`
}
shellutils.R(&QuotaListOptions{}, "quota-list", "List quotas", func(cli *zstack.SRegion, args *QuotaListOptions) error {
quotas, err := cli.GetQuotas()
if err != nil {
return err
}
printList(quotas, 0, 0, 0, nil)
R(&CloudmetaOptions{}, "instance-type-list", "query backend service for its version", func(s *mcclient.ClientSession, args *CloudmetaOptions) error {
return nil
})
}

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

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package compute
package shell
import (
"yunion.io/x/jsonutils"
@@ -27,8 +27,6 @@ func init() {
type CloudproviderRegionListOptions struct {
options.BaseListOptions
Region string `help:"ID or Name of Host"`
Capability []string `help:"capability filter" choices:"project|compute|network|loadbalancer|objectstore|rds|cache|event"`
}
R(&CloudproviderRegionListOptions{}, "cloud-provider-region-list", "List cloudprovider region synchronization status", func(s *mcclient.ClientSession, args *CloudproviderRegionListOptions) error {
var params *jsonutils.JSONDict

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package compute
package shell
import (
"fmt"
@@ -31,10 +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"`
Cloudregion string `help:"filter cloudproviders by cloudregion"`
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
@@ -54,14 +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")
}
if len(args.Cloudregion) > 0 {
params.Add(jsonutils.NewString(args.Cloudregion), "cloudregion")
}
}
result, err := modules.Cloudproviders.List(s, params)
if err != nil {
@@ -250,13 +240,4 @@ func init() {
printObject(result)
return nil
})
R(&CloudproviderShowOptions{}, "cloud-provider-change-owner-candidate-domains", "Show candiate domains of a cloud provider changing owner", func(s *mcclient.ClientSession, args *CloudproviderShowOptions) error {
result, err := modules.Cloudproviders.GetSpecific(s, args.ID, "change-owner-candidate-domains", nil)
if err != nil {
return err
}
printObject(result)
return nil
})
}

View File

@@ -12,11 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package compute
package shell
import (
"fmt"
"yunion.io/x/jsonutils"
"yunion.io/x/onecloud/pkg/mcclient"
@@ -34,25 +32,12 @@ func init() {
Service string `help:"List regions which service has available skus" choices:"dbinstances|servers"`
City string `help:"List regions in the specified city"`
Capability []string `help:"capability filter" choices:"project|compute|network|loadbalancer|objectstore|rds|cache|event"`
DistinctField string `help:"list the specified distinct field, e.g. city, region"`
}
R(&CloudregionListOptions{}, "cloud-region-list", "List cloud regions", func(s *mcclient.ClientSession, opts *CloudregionListOptions) error {
params, err := options.ListStructToParams(opts)
if err != nil {
return err
}
if len(opts.DistinctField) > 0 {
params.Add(jsonutils.NewString(opts.DistinctField), "extra_field")
result, err := modules.Cloudregions.Get(s, "distinct-field", params)
if err != nil {
return err
}
fmt.Println(result)
return nil
}
result, err := modules.Cloudregions.List(s, params)
if err != nil {
return err

View File

@@ -1,60 +0,0 @@
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package compute
import (
"yunion.io/x/jsonutils"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func init() {
type CloudproviderQuotaListOptions struct {
options.BaseListOptions
Cloudregion string `help:"ID or Name of Cloudregion"`
QuotaType string `help:"Quota type"`
QuotaRange string `help:"Quota range" choices:"cloudregion|cloudprovider"`
}
R(&CloudproviderQuotaListOptions{}, "cloud-provider-quota-list", "List cloudprovider quota", func(s *mcclient.ClientSession, args *CloudproviderQuotaListOptions) error {
params, err := args.Params()
if err != nil {
return err
}
if len(args.QuotaType) > 0 {
params.Add(jsonutils.NewString(args.QuotaType), "quota_type")
}
if len(args.QuotaRange) > 0 {
params.Add(jsonutils.NewString(args.QuotaRange), "quota_range")
}
if len(args.Cloudregion) > 0 {
params.Add(jsonutils.NewString(args.Cloudregion), "cloudregion")
}
result, err := modules.CloudproviderQuotas.List(s, params)
if err != nil {
return err
}
printList(result, modules.CloudproviderQuotas.GetColumns(s))
return nil
})
}

View File

@@ -1,34 +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/cmd/climc/shell"
"yunion.io/x/onecloud/pkg/util/printutils"
)
var (
R = shell.R
printList = printutils.PrintJSONList
printObject = printutils.PrintJSONObject
printBatchResults = printutils.PrintJSONBatchResults
InvalidUpdateError = shell.InvalidUpdateError
printObjectRecursive = printutils.PrintJSONObjectRecursive
exportList = shell.ExportList
printObjectRecursiveEx = printutils.PrintJSONObjectRecursiveEx
)

View File

@@ -1,109 +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 (
"fmt"
"yunion.io/x/jsonutils"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func init() {
type GlobalVpcListOptions struct {
options.BaseListOptions
}
R(&GlobalVpcListOptions{}, "global-vpc-list", "List global vpcs", func(s *mcclient.ClientSession, args *GlobalVpcListOptions) error {
params, err := options.ListStructToParams(args)
if err != nil {
return err
}
result, err := modules.GlobalVpcs.List(s, params)
if err != nil {
return err
}
printList(result, modules.GlobalVpcs.GetColumns(s))
return nil
})
type GlobalVpcShowOptions struct {
ID string `help:"ID or Name of globalvpc"`
}
R(&GlobalVpcShowOptions{}, "global-vpc-show", "Show details of a global vpc", func(s *mcclient.ClientSession, args *GlobalVpcShowOptions) error {
result, err := modules.GlobalVpcs.GetById(s, args.ID, nil)
if err != nil {
return err
}
printObject(result)
return nil
})
type GlobalVpcPublicOptions struct {
ID string `help:"ID or name of global vpc" json:"-"`
Scope string `help:"sharing scope" choices:"system|domain"`
SharedDomains []string `help:"share to domains"`
}
R(&GlobalVpcPublicOptions{}, "global-vpc-public", "Make global vpc public", func(s *mcclient.ClientSession, args *GlobalVpcPublicOptions) error {
params := jsonutils.Marshal(args)
result, err := modules.GlobalVpcs.PerformAction(s, args.ID, "public", params)
if err != nil {
return err
}
printObject(result)
return nil
})
type GlobalVpcPrivateOptions struct {
ID string `help:"ID or name of global vpc" json:"-"`
}
R(&GlobalVpcPrivateOptions{}, "global-vpc-private", "Make global vpc private", func(s *mcclient.ClientSession, args *GlobalVpcPrivateOptions) error {
params := jsonutils.Marshal(args)
result, err := modules.GlobalVpcs.PerformAction(s, args.ID, "private", params)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&GlobalVpcShowOptions{}, "global-vpc-change-owner-candidate-domains", "Show candiate domains of a global vpc for changing owner", func(s *mcclient.ClientSession, args *GlobalVpcShowOptions) error {
result, err := modules.GlobalVpcs.GetSpecific(s, args.ID, "change-owner-candidate-domains", nil)
if err != nil {
return err
}
printObject(result)
return nil
})
type GlobalVpcChangeOwnerOptions struct {
ID string `help:"ID or name of vpc" json:"-"`
ProjectDomain string `json:"project_domain" help:"target domain"`
}
R(&GlobalVpcChangeOwnerOptions{}, "global-vpc-change-owner", "Change owner domain of a global vpc", func(s *mcclient.ClientSession, args *GlobalVpcChangeOwnerOptions) error {
if len(args.ProjectDomain) == 0 {
return fmt.Errorf("empty project_domain")
}
params := jsonutils.Marshal(args)
ret, err := modules.GlobalVpcs.PerformAction(s, args.ID, "change-owner", params)
if err != nil {
return err
}
printObject(ret)
return nil
})
}

View File

@@ -1,62 +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/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func init() {
type PolicyListOptions struct {
options.BaseListOptions
}
R(&PolicyListOptions{}, "policy-definition-list", "List policy definitions", func(s *mcclient.ClientSession, args *PolicyListOptions) error {
params, err := args.Params()
if err != nil {
return err
}
result, err := modules.PolicyDefinition.List(s, params)
if err != nil {
return err
}
printList(result, modules.PolicyDefinition.GetColumns(s))
return nil
})
type PolicyIdOptions struct {
ID string `help:"policy definition name or id"`
}
R(&PolicyIdOptions{}, "policy-definition-show", "Show policy definition", func(s *mcclient.ClientSession, args *PolicyIdOptions) error {
result, err := modules.PolicyDefinition.Get(s, args.ID, nil)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&PolicyIdOptions{}, "policy-definition-syncstatus", "Sync policy definition status", func(s *mcclient.ClientSession, args *PolicyIdOptions) error {
result, err := modules.PolicyDefinition.PerformAction(s, args.ID, "syncstatus", nil)
if err != nil {
return err
}
printObject(result)
return nil
})
}

View File

@@ -1,101 +0,0 @@
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package compute
import (
"yunion.io/x/jsonutils"
"yunion.io/x/onecloud/pkg/mcclient"
"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
})
R(&options.ProxySettingPublicOptions{}, "proxysetting-public", "Make proxysetting public", func(s *mcclient.ClientSession, opts *options.ProxySettingPublicOptions) error {
params := jsonutils.Marshal(opts)
result, err := modules.ProxySettings.PerformAction(s, opts.ID, "public", params)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&options.ProxySettingPrivateOptions{}, "proxysetting-private", "Make proxysetting private", func(s *mcclient.ClientSession, opts *options.ProxySettingPrivateOptions) error {
params := jsonutils.Marshal(opts)
result, err := modules.ProxySettings.PerformAction(s, opts.ID, "private", params)
if err != nil {
return err
}
printObject(result)
return nil
})
}

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/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func init() {
type ScalingActivityListOptions struct {
options.BaseListOptions
}
R(&ScalingActivityListOptions{}, "scaling-activity-list", "List Scaling Activity",
func(s *mcclient.ClientSession, args *ScalingActivityListOptions) error {
params, err := options.ListStructToParams(args)
if err != nil {
return err
}
list, err := modules.ScalingActivity.List(s, params)
if err != nil {
return err
}
printList(list, modules.ScalingActivity.GetColumns(s))
return nil
},
)
}

View File

@@ -1,145 +0,0 @@
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package compute
import (
"yunion.io/x/jsonutils"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func init() {
type ScalingGroupListOptions struct {
options.BaseListOptions
Hypervisor string `help:"Hypervisor"`
Cloudregion string `help:"Cloudregion"`
Network string `help:"network"`
}
R(&ScalingGroupListOptions{}, "scaling-group-list", "List scaling group", func(s *mcclient.ClientSession, args *ScalingGroupListOptions) error {
params, err := options.ListStructToParams(args)
if err != nil {
return err
}
result, err := modules.ScalingGroup.List(s, params)
if err != nil {
return err
}
printList(result, modules.ScalingGroup.GetColumns(s))
return nil
})
type ScalingGroupShowOptions struct {
ID string
}
R(&ScalingGroupShowOptions{}, "scaling-group-show", "Show scaling group", func(s *mcclient.ClientSession,
args *ScalingGroupShowOptions) error {
result, err := modules.ScalingGroup.Get(s, args.ID, nil)
if err != nil {
return err
}
printObject(result)
return nil
})
type ScalingGroupCreateOptions struct {
NAME string
Hypervisor string
Cloudregion string
Network string
GuestTemplate string
MinInstanceNumber string
MaxInstanceNumber string
DesireInstanceNumber string
Loadbalance string
}
R(&ScalingGroupCreateOptions{}, "scaling-group-create", "Create scaling group", func(s *mcclient.ClientSession, args *ScalingGroupCreateOptions) error {
params := jsonutils.Marshal(args).(*jsonutils.JSONDict)
scalingGroup, err := modules.ScalingGroup.Create(s, params)
if err != nil {
return err
}
printObject(scalingGroup)
return nil
})
type ScalingGroupDeleteOptions struct {
ID string `help:"ScalingGroup ID or Name"`
}
R(&ScalingGroupDeleteOptions{}, "scaling-group-delete", "Delete Scaling Group", func(s *mcclient.ClientSession,
args *ScalingGroupDeleteOptions) error {
scalingGroup, err := modules.ScalingGroup.Delete(s, args.ID, jsonutils.NewDict())
if err != nil {
return err
}
printObject(scalingGroup)
return nil
})
type ScalingGroupListInstanceOptions struct {
ID string `help:"ScalingGroup ID or Name"`
}
R(&ScalingGroupListInstanceOptions{}, "scaling-group-list-instance", "List all instance of Scaling Group",
func(s *mcclient.ClientSession, args *ScalingGroupListInstanceOptions) error {
params := jsonutils.NewDict()
params.Set("scaling_group", jsonutils.NewString(args.ID))
servers, err := modules.Servers.List(s, params)
if err != nil {
return err
}
printList(servers, modules.Servers.GetColumns(s))
return nil
},
)
type ScalingGroupRemoveInstanceOptions struct {
ID string `help:"ScalingGroup ID or Name"`
SERVER string `help:"Server ID or Name"`
Delete bool `help:"If delete the server"`
}
R(&ScalingGroupRemoveInstanceOptions{}, "scaling-group-remove-instance", "Remove instance of ScalingGroup",
func(s *mcclient.ClientSession, args *ScalingGroupRemoveInstanceOptions) error {
params := jsonutils.NewDict()
params.Set("scaling_group", jsonutils.NewString(args.ID))
params.Set("delete_server", jsonutils.NewBool(args.Delete))
server, err := modules.Servers.PerformAction(s, args.SERVER, "detach-scaling-group", params)
if err != nil {
return err
}
printObject(server)
return nil
},
)
type ScalingGroupEnableOptions struct {
ID string `help:"ScalingGroup ID or Name"`
}
R(&ScalingGroupEnableOptions{}, "scaling-group-enable", "Enable ScalingGroup", func(s *mcclient.ClientSession,
args *ScalingGroupEnableOptions) error {
ret, err := modules.ScalingGroup.PerformAction(s, args.ID, "enable", jsonutils.NewDict())
if err != nil {
return err
}
printObject(ret)
return nil
})
R(&ScalingGroupEnableOptions{}, "scaling-group-disable", "Disable ScalingGroup", func(s *mcclient.ClientSession,
args *ScalingGroupEnableOptions) error {
ret, err := modules.ScalingGroup.PerformAction(s, args.ID, "disable", jsonutils.NewDict())
if err != nil {
return err
}
printObject(ret)
return nil
})
}

View File

@@ -1,202 +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 (
"fmt"
"time"
"yunion.io/x/jsonutils"
api "yunion.io/x/onecloud/pkg/apis/compute"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
type Timer struct {
TimingExecTime string `help:"Exectime for 'timing' type trigger, format:'2006-01-02 15:04:05'" json:"exec_time"`
}
type CycleTimer struct {
CycleCycleType string `help:"Cycle type for cycle timer" json:"cycle_type" choices:"day|week|month"`
CycleMinute int `help:"Minute of cycle timer" json:"minute"`
CycleHour int `help:"Hour of cycle timer" json:"hour"`
CycleWeekdays []int `help:"Weekdays for cycle timer" json:"weekdays"`
CycleMonthDays []int `help:"Month days for cycle timer" json:"month_days"`
CycleStartTime string `help:"Start time for cycle timer, format:'2006-01-02 15:04:05'" json:"start_time"`
CycleEndTime string `help:"End time for cycle timer, format:'2006-01-02 15:04:05'" json:"end_time"`
}
func init() {
type ScalingPolicyListOptions struct {
options.BaseListOptions
ScalingGroup string `help:"ScalingGroup ID or Name"`
TriggerType string `help:"Trigger type" choices:"alarm|timing|cycle"`
}
R(&ScalingPolicyListOptions{}, "scaling-policy-list", "List Scaling Policy", func(s *mcclient.ClientSession,
args *ScalingPolicyListOptions) error {
params, err := options.ListStructToParams(args)
policies, err := modules.ScalingPolicy.List(s, params)
if err != nil {
return err
}
printList(policies, modules.ScalingPolicy.GetColumns(s))
return nil
})
type ScalingPolicyShowOptions struct {
ID string `help:"ScalingPolicy ID or Name"`
}
R(&ScalingPolicyShowOptions{}, "scaling-policy-show", "Show Scaling Policy", func(s *mcclient.ClientSession,
args *ScalingPolicyShowOptions) error {
params := jsonutils.NewDict()
params.Set("details", jsonutils.JSONTrue)
policy, err := modules.ScalingPolicy.Get(s, args.ID, params)
if err != nil {
return err
}
printObject(policy)
return nil
})
type ScalingAlarm struct {
AlarmCumulate int `help:"Cumulate times alarm will trigger, for 'alarm' trigger" json:"cumulate"`
AlarmCycle int `help:"Monitoring cycle for indicators, for 'alarm' trigger" json:"cycle"`
AlarmIndicator string `help:"Indicator for 'alarm' trigger" json:"indicator"`
AlarmWrapper string `help:"Wrapper for Indicators" choices:"max|min|average" json:"wrapper"`
AlarmOperator string `help:"Operator between Indicator and Operator" json:"operator"`
AlarmValue float64 `help:"Value of Indicator" json:"value"`
}
type ScalingPolicyCreateOptions struct {
NAME string `help:"ScalingPolicy Name" json:"name"`
ScalingGroup string `help:"ScalingGroup ID or Name" json:"scaling_group"`
TriggerType string `help:"Trigger type" choices:"alarm|timing|cycle" json:"trigger_type"`
Timer
CycleTimer
ScalingAlarm
Action string `help:"Action for scaling policy" choices:"add|remove|set" json:"action"`
Number int `help:"Instance number for action" json:"number"`
Unit string `help:"Unit for Number" choices:"s|%" json:"unit"`
CoolingTime int `help:"Cooling time, unit: s" json:"cooling_time"`
}
R(&ScalingPolicyCreateOptions{}, "scaling-policy-create", "Create Scaling Policy",
func(s *mcclient.ClientSession, args *ScalingPolicyCreateOptions) error {
formatStr := "2006-01-02 15:04:05"
timingExecTime, err := time.Parse(formatStr, args.TimingExecTime)
if err != nil {
return fmt.Errorf("invalid time format for 'exec_time'")
}
cycleStarTime, err := time.Parse(formatStr, args.CycleStartTime)
if err != nil {
return fmt.Errorf("invalid time format for 'start_time'")
}
cycleEndTime, err := time.Parse(formatStr, args.CycleEndTime)
if err != nil {
return fmt.Errorf("invalid time format for 'end_time'")
}
spCreateInput := api.ScalingPolicyCreateInput{
ScalingGroup: args.ScalingGroup,
TriggerType: args.TriggerType,
Timer: api.TimerCreateInput{
ExecTime: timingExecTime,
},
CycleTimer: api.CycleTimerCreateInput{
CycleType: args.CycleCycleType,
Minute: args.CycleMinute,
Hour: args.CycleHour,
WeekDays: args.CycleWeekdays,
MonthDays: args.CycleMonthDays,
StartTime: cycleStarTime,
EndTime: cycleEndTime,
},
Alarm: api.ScalingAlarmCreateInput{
Cumulate: args.AlarmCumulate,
Cycle: args.AlarmCycle,
Indicator: args.AlarmIndicator,
Wrapper: args.AlarmWrapper,
Operator: args.AlarmOperator,
Value: args.AlarmValue,
},
Action: args.Action,
Number: args.Number,
Unit: args.Unit,
CoolingTime: args.CoolingTime,
}
spCreateInput.Name = args.NAME
ret, err := modules.ScalingPolicy.Create(s, jsonutils.Marshal(spCreateInput))
if err != nil {
return err
}
printObject(ret)
return nil
},
)
type ScalingPolicyEnableOptions struct {
ID string `help:"ScalingPolicy ID or Name"`
}
R(&ScalingPolicyEnableOptions{}, "scaling-policy-enable", "Enable ScalingPolicy", func(s *mcclient.ClientSession,
args *ScalingPolicyEnableOptions) error {
ret, err := modules.ScalingPolicy.PerformAction(s, args.ID, "enable", jsonutils.NewDict())
if err != nil {
return err
}
printObject(ret)
return nil
})
R(&ScalingPolicyEnableOptions{}, "scaling-policy-disable", "Disable ScalingPolicy",
func(s *mcclient.ClientSession, args *ScalingPolicyEnableOptions) error {
ret, err := modules.ScalingPolicy.PerformAction(s, args.ID, "disable", jsonutils.NewDict())
if err != nil {
return err
}
printObject(ret)
return nil
},
)
type ScalingPolicyTriggerOptions struct {
ID string `help:"ScalingPolicy ID or Name"`
}
R(&ScalingPolicyTriggerOptions{}, "scaling-policy-trigger", "Trigger ScalingPolicy's action",
func(s *mcclient.ClientSession, args *ScalingPolicyTriggerOptions) error {
ret, err := modules.ScalingPolicy.PerformAction(s, args.ID, "trigger", jsonutils.NewDict())
if err != nil {
return err
}
printObject(ret)
return nil
},
)
type ScalingPolicyDeleteOptions struct {
ID string `help:"ScalingPolicy ID or Name"`
}
R(&ScalingPolicyDeleteOptions{}, "scaling-policy-delete", "Delete SclaingPolicy",
func(s *mcclient.ClientSession, args *ScalingPolicyDeleteOptions) error {
ret, err := modules.ScalingPolicy.Delete(s, args.ID, jsonutils.NewDict())
if err != nil {
return err
}
printObject(ret)
return nil
},
)
}

View File

@@ -1,211 +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 (
"fmt"
"time"
"yunion.io/x/jsonutils"
apis "yunion.io/x/onecloud/pkg/apis/compute"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func init() {
type ScheduledTaskListOptions struct {
options.BaseListOptions
ScheduledType string `help:"scheduled type" choices:"timing|cycle"`
ResourceType string `help:"resource type"`
Operation string `help:"operation"`
}
R(&ScheduledTaskListOptions{}, "scheduledtask-list", "list Scheduled Task", func(s *mcclient.ClientSession, args *ScheduledTaskListOptions) error {
params, err := options.ListStructToParams(args)
tasks, err := modules.ScheduledTask.List(s, params)
if err != nil {
return err
}
printList(tasks, modules.ScheduledTask.GetColumns(s))
return nil
})
type ScheduledTaskShowOptions struct {
ID string `help:"ScheduledTask ID or Name"`
}
R(&ScheduledTaskShowOptions{}, "scheudled-task-show", "Show Scheduled Task", func(s *mcclient.ClientSession,
args *ScheduledTaskShowOptions) error {
params := jsonutils.NewDict()
params.Set("details", jsonutils.JSONTrue)
task, err := modules.ScheduledTask.Get(s, args.ID, params)
if err != nil {
return err
}
printObject(task)
return nil
})
type ScheduledTaskCreateOptions struct {
NAME string `help:"ScheduledTask Name" json:"name"`
ScheduledType string `help:"Scheudled Type" choices:"timing|cycle" json:"scheduled_type"`
Timer
CycleTimer
ResourceType string `help:"resource type"`
Operation string `help:"operation"`
LabelType string `help:"label type"`
Labels []string `help:"labels"`
}
R(&ScheduledTaskCreateOptions{}, "scheduledtask-create", "Create Scheduled Task", func(s *mcclient.ClientSession, args *ScheduledTaskCreateOptions) error {
formatStr := "2006-01-02 15:04:05"
var exectime, starttime, endtime time.Time
var err error
if len(args.TimingExecTime) > 0 {
exectime, err = time.Parse(formatStr, args.TimingExecTime)
if err != nil {
return fmt.Errorf("invalid time format for 'exec_time'")
}
}
if len(args.CycleStartTime) > 0 {
starttime, err = time.Parse(formatStr, args.CycleStartTime)
if err != nil {
return fmt.Errorf("invalid time format for 'start_time'")
}
}
if len(args.CycleEndTime) > 0 {
endtime, err = time.Parse(formatStr, args.CycleEndTime)
if err != nil {
return fmt.Errorf("invalid time format for 'end_time'")
}
}
stCreateInput := apis.ScheduledTaskCreateInput{
ScheduledType: args.ScheduledType,
Timer: apis.TimerCreateInput{
ExecTime: exectime,
},
CycleTimer: apis.CycleTimerCreateInput{
CycleType: args.CycleCycleType,
Minute: args.CycleMinute,
Hour: args.CycleHour,
WeekDays: args.CycleWeekdays,
MonthDays: args.CycleMonthDays,
StartTime: starttime,
EndTime: endtime,
},
ResourceType: args.ResourceType,
Operation: args.Operation,
LabelType: args.LabelType,
Labels: args.Labels,
}
stCreateInput.Name = args.NAME
ret, err := modules.ScheduledTask.Create(s, jsonutils.Marshal(stCreateInput))
if err != nil {
return err
}
printObject(ret)
return nil
})
type ScheduledTaskEnableOptions struct {
ID string `help:"ScheduledTask ID or Name"`
}
R(&ScheduledTaskEnableOptions{}, "scheduledtask-enable", "Enable ScheduledTask", func(s *mcclient.ClientSession,
args *ScheduledTaskEnableOptions) error {
ret, err := modules.ScheduledTask.PerformAction(s, args.ID, "enable", jsonutils.NewDict())
if err != nil {
return err
}
printObject(ret)
return nil
})
R(&ScheduledTaskEnableOptions{}, "scheduledtask-disable", "Disable ScheduledTask",
func(s *mcclient.ClientSession, args *ScheduledTaskEnableOptions) error {
ret, err := modules.ScheduledTask.PerformAction(s, args.ID, "disable", jsonutils.NewDict())
if err != nil {
return err
}
printObject(ret)
return nil
},
)
type ScheduledTaskSetLabelsOptions struct {
ID string `help:"ScheduledTask ID or Name"`
Labels []string `help:"Label"`
}
R(&ScheduledTaskSetLabelsOptions{}, "scheduledtask-setlabels", "Trigger ScheduledTask's action",
func(s *mcclient.ClientSession, args *ScheduledTaskSetLabelsOptions) error {
params := jsonutils.NewDict()
params.Set("labels", jsonutils.Marshal(args.Labels))
ret, err := modules.ScheduledTask.PerformAction(s, args.ID, "set-labels", params)
if err != nil {
return err
}
printObject(ret)
return nil
},
)
type ScheduledTaskTriggerOptions struct {
ID string `help:"ScheduledTask ID or Name"`
}
R(&ScheduledTaskTriggerOptions{}, "scheduledtask-trigger", "Trigger ScheduledTask",
func(s *mcclient.ClientSession, args *ScheduledTaskTriggerOptions) error {
params := jsonutils.NewDict()
ret, err := modules.ScheduledTask.PerformAction(s, args.ID, "trigger", params)
if err != nil {
return err
}
printObject(ret)
return nil
},
)
type ScheduledTaskDeleteOptions struct {
ID string `help:"ScheduledTask ID or Name"`
}
R(&ScheduledTaskDeleteOptions{}, "scheduledtask-delete", "Delete ScheduledTask",
func(s *mcclient.ClientSession, args *ScheduledTaskDeleteOptions) error {
ret, err := modules.ScheduledTask.Delete(s, args.ID, jsonutils.NewDict())
if err != nil {
return err
}
printObject(ret)
return nil
},
)
type ScheduledTaskAvtivityListOptions struct {
options.BaseListOptions
ScheduledTask string `help:"Scheduled Task" json:"scheduled_task"`
}
R(&ScheduledTaskAvtivityListOptions{}, "scheduledtask-activity-list", "List Scheduled Task Activity",
func(s *mcclient.ClientSession, args *ScheduledTaskAvtivityListOptions) error {
params, err := options.ListStructToParams(args)
if err != nil {
return err
}
list, err := modules.ScheduledTaskActivity.List(s, params)
if err != nil {
return err
}
printList(list, modules.ScheduledTaskActivity.GetColumns(s))
return nil
},
)
}

View File

@@ -1,72 +0,0 @@
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package compute
import (
"yunion.io/x/jsonutils"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modulebase"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func init() {
type ServerSecgroupListOptions struct {
options.BaseListOptions
Server string `help:"ID or Name of Server"`
Secgroup string `help:"Secgroup ID or name"`
}
R(&ServerSecgroupListOptions{}, "server-secgroup-list", "List server secgroup pairs", func(s *mcclient.ClientSession, args *ServerSecgroupListOptions) error {
var params *jsonutils.JSONDict
{
var err error
params, err = args.BaseListOptions.Params()
if err != nil {
return err
}
}
var result *modulebase.ListResult
var err error
if len(args.Server) > 0 {
result, err = modules.Serversecgroups.ListDescendent(s, args.Server, params)
} else if len(args.Secgroup) > 0 {
result, err = modules.Serversecgroups.ListDescendent2(s, args.Secgroup, params)
} else {
result, err = modules.Serversecgroups.List(s, params)
}
if err != nil {
return err
}
printList(result, modules.Serversecgroups.GetColumns(s))
return nil
})
type ServerSecgroupDetailOptions struct {
SERVER string `help:"ID or Name of Server"`
SECGROUP string `help:"ID or Name of Security Group"`
}
R(&ServerSecgroupDetailOptions{}, "server-secgroup-show", "Show server security group details", func(s *mcclient.ClientSession, args *ServerSecgroupDetailOptions) error {
query := jsonutils.NewDict()
result, err := modules.Serversecgroups.Get(s, args.SERVER, args.SECGROUP, query)
if err != nil {
return err
}
printObject(result)
return nil
})
}

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package notify
package shell
import (
"yunion.io/x/jsonutils"

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package notify
package shell
import (
"yunion.io/x/jsonutils"

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