Compare commits

..

675 Commits

Author SHA1 Message Date
yunion-ci-robot
a1760d7b86 Merge pull request #8537 from rainzm/automated-cherry-pick-of-#8535-upstream-release-3.4
Automated cherry pick of #8535: refactor(region): faster list for cachedimage
2020-10-28 17:58:42 +08:00
rainzm
c456586860 refactor(region): faster list for cachedimage
Pro version of #8440 with checking the necessity of id filtering
2020-10-28 15:36:03 +08:00
yunion-ci-robot
71e759a032 Merge pull request #8527 from rainzm/automated-cherry-pick-of-#8525-upstream-release-3.4
Automated cherry pick of #8525: fix(esxi): no callback in uploadHandler
2020-10-28 00:59:42 +08:00
yunion-ci-robot
96ce64d5f0 Merge pull request #8514 from ioito/automated-cherry-pick-of-#8512-upstream-release-3.4
Automated cherry pick of #8512: fix: avoid sync project panic
2020-10-28 00:48:42 +08:00
rainzm
d31802c87b fix(esxi): filter vmdk item in lease.info 2020-10-27 21:32:21 +08:00
rainzm
d3964bf0d1 fix(esxi): use correct device index
1. Sort devices via their Key.
2. There is no relationship between vdisk index and vnics length.
2020-10-27 21:32:21 +08:00
rainzm
57dad6281a fix(esxi): no callback in uploadHandler 2020-10-27 21:32:21 +08:00
Zexi Li
b74130903e Merge pull request #8519 from ioito/automated-cherry-pick-of-#8517-upstream-release-3.4
Automated cherry pick of #8517: fix: set secgroup status
2020-10-27 17:28:39 +08:00
Qu Xuan
44046f2861 fix: set secgroup status 2020-10-27 16:20:06 +08:00
Qu Xuan
95f7600b67 fix: avoid sync project panic 2020-10-27 16:13:48 +08:00
yunion-ci-robot
749b819a62 Merge pull request #8501 from yousong/automated-cherry-pick-of-#8499-upstream-release-3.4
Automated cherry pick of #8499: lockman: test: add prefix setting
2020-10-26 21:24:40 +08:00
Yousong Zhou
f7f7c7be81 lockman: test: add prefix setting 2020-10-26 20:36:32 +08:00
yunion-ci-robot
6a221dbc1e Merge pull request #8498 from zhaoxiangchun/automated-cherry-pick-of-#8496-upstream-release-3.4
Automated cherry pick of #8496: commalertUpdateInput increat param:
2020-10-26 19:55:47 +08:00
zhaoxiangchun
002a2af272 commalertUpdateInput increat param:
1.处理operator对alertType == system的报警策略的update请求
2020-10-26 18:21:11 +08:00
yunion-ci-robot
1757d3d6a9 Merge pull request #8494 from rainzm/automated-cherry-pick-of-#8493-upstream-release-3.4
Automated cherry pick of #8493: fix(region): roll back the optimization of cachedimage list
2020-10-26 18:17:39 +08:00
rainzm
be5a6a93cc fix(region): roll back the optimization of cachedimage list 2020-10-26 17:37:59 +08:00
yunion-ci-robot
bbbe78dbef Merge pull request #8489 from ioito/automated-cherry-pick-of-#8487-upstream-release-3.4
Automated cherry pick of #8487: fix: avoid delete public ip when sync eip list
2020-10-26 17:02:42 +08:00
Qu Xuan
a851e01330 fix: avoid delete public ip when sync eip list 2020-10-26 16:18:46 +08:00
yunion-ci-robot
29d06d52dd Merge pull request #8466 from wanyaoqi/automated-cherry-pick-of-#8464-upstream-release-3.4
Automated cherry pick of #8464: check disk is in reset before delete snapshot
2020-10-25 10:54:39 +08:00
yunion-ci-robot
1a6d4d1035 Merge pull request #8486 from swordqiu/automated-cherry-pick-of-#8484-upstream-release-3.4
Automated cherry pick of #8484: fix: server usage status not correct
2020-10-25 10:52:41 +08:00
Qiu Jian
90d649aef9 fix: server usage status not correct 2020-10-25 08:38:48 +08:00
Zexi Li
23b99a6232 Merge pull request #8472 from wanyaoqi/automated-cherry-pick-of-#8470-upstream-release-3.4
Automated cherry pick of #8470: fix on stream disk complete snapshots refcount not update
2020-10-24 13:09:42 +08:00
Zexi Li
16c38fe6be Merge pull request #8476 from zexi/automated-cherry-pick-of-#8474-upstream-release-3.4
Automated cherry pick of #8474: monitor: set default influxdb datasource by endpoint type
2020-10-24 13:07:07 +08:00
Zexi Li
b43f8b3fac monitor: set default influxdb datasource by endpoint type 2020-10-23 20:10:08 +08:00
wanyaoqi
8e5b74a3f6 fix on stream disk complete snapshots refcount not update 2020-10-23 19:11:32 +08:00
yunion-ci-robot
b0cd3bf999 Merge pull request #8414 from zhaoxiangchun/automated-cherry-pick-of-#8412-upstream-release-3.4
Automated cherry pick of #8412: bugfix:
2020-10-23 18:35:17 +08:00
yunion-ci-robot
4a15284684 Merge pull request #8463 from rainzm/automated-cherry-pick-of-#8461-upstream-release-3.4
Automated cherry pick of #8461: fix(glance): allow public and private operations of guestimage
2020-10-23 18:29:15 +08:00
wanyaoqi
d78068d43a check disk is in reset before delete snapshot 2020-10-23 18:26:22 +08:00
yunion-ci-robot
80dce5eafb Merge pull request #8452 from wanyaoqi/automated-cherry-pick-of-#8450-upstream-release-3.4
Automated cherry pick of #8450: host increase cpu mem max size
2020-10-23 18:18:20 +08:00
yunion-ci-robot
950696ddb9 Merge pull request #8458 from rainzm/automated-cherry-pick-of-#8456-upstream-release-3.4
Automated cherry pick of #8456: fix(esxi): resize root disk after cloning vm
2020-10-23 18:17:20 +08:00
zhaoxiangchun
e7674116e1 bugfix:
1.资源报警增加websocket 消息通知:admin用户
2.统一influxdb中查询到的tag展示
2020-10-23 17:58:20 +08:00
rainzm
3fae388db5 fix(glance): allow public and private operations of guestimage
The public and private operations of the guest image depends on these operations of the subimage.
2020-10-23 17:57:48 +08:00
rainzm
8f3b8c7ff1 fix(esxi): resize root disk after cloning vm
The root disk size set when the machine is cloned does not take effect,
so set the root disk size after the machine is cloned.
2020-10-23 17:03:52 +08:00
wanyaoqi
a4b1d3952d host increase cpu mem max size 2020-10-23 15:15:55 +08:00
yunion-ci-robot
a5ef16243d Merge pull request #8442 from rainzm/automated-cherry-pick-of-#8440-upstream-release-3.4
Automated cherry pick of #8440: refactor(region): faster list for cachedimage
2020-10-22 21:25:14 +08:00
rainzm
b0823a09bb refactor(region): faster list for cachedimage
修改之前:
诸如provider, zone, host_schedtag_id, valid
等过滤条件,是通过过滤出符合条件的 storagecachedimage 然后使用 cachedimage_id 来过滤 cachedimge,
问题是,每一个过滤条件都会独立的去执行上面的过程,这样同样的查询可能要经过很多次,并且如果遇到
弱的过滤条件,比如 valid ,过滤出来的 storagecachedimage
非常之多,然后在使用 cachedimage_id 去过滤 cachedimage,会非常慢。

修改之后:
过滤条件的相似的逻辑合并起来,只需要向 subQuery 中添加 filter,使用 subQuery 一次把 storagecachedimage
过滤出来,然后使用 cachedimage_id 过滤 cachedimage。
2020-10-22 20:18:40 +08:00
yunion-ci-robot
492920ac7c Merge pull request #8428 from ioito/automated-cherry-pick-of-#8426-upstream-release-3.4
Automated cherry pick of #8426: fix: 避免冲掉设置的到期释放时间
2020-10-22 20:13:22 +08:00
yunion-ci-robot
f96ac33175 Merge pull request #8433 from lvyangyang/automated-cherry-pick-of-#8416-upstream-release-3.4
Automated cherry pick of #8416: fix:get all project dns resource
2020-10-22 20:10:19 +08:00
yunion-ci-robot
1bc16d6f2e Merge pull request #8439 from rainzm/automated-cherry-pick-of-#8437-upstream-release-3.4
Automated cherry pick of #8437: fix(region): add suffix 'display' for time_points and repeat_weekdays
2020-10-22 20:07:17 +08:00
rainzm
0ba8cb7fbd fix: don't update NextSyncTime when snapshots that should be added has not 2020-10-22 19:42:26 +08:00
rainzm
93bb4022f2 fix(region): init NextSyncTimeiwhen create snapshotpolicydisks 2020-10-22 19:42:26 +08:00
rainzm
bbfb9db90a fix(region): add suffix 'display' for time_points and repeat_weekdays
TimePoints and RepeatWeekdays in SnapshotPolicyDetails is duplicated
with thess in SnapshotPolicy, which result in the fault of reponse for
request GET.
2020-10-22 19:42:26 +08:00
lvyangyang
66c81ee548 fix:get all project dns resource 2020-10-22 17:06:00 +08:00
Qu Xuan
8f3cb9cdbb fix: 避免冲掉设置的到期释放时间 2020-10-22 15:41:19 +08:00
yunion-ci-robot
1ac71d0016 Merge pull request #8409 from wanyaoqi/automated-cherry-pick-of-#8407-upstream-release-3.4
Automated cherry pick of #8407: fix informer backend
2020-10-22 15:04:16 +08:00
yunion-ci-robot
e8238a2cf5 Merge pull request #8425 from ioito/automated-cherry-pick-of-#8423-upstream-release-3.4
Automated cherry pick of #8423: fix: add aliyun new region
2020-10-22 14:31:17 +08:00
Qu Xuan
22349276d9 fix: add aliyun new region 2020-10-22 11:53:08 +08:00
wanyaoqi
d6a9b5dac2 fix informer backend 2020-10-21 10:54:14 +08:00
yunion-ci-robot
0e3aa96f77 Merge pull request #8406 from rainzm/automated-cherry-pick-of-#8404-upstream-release-3.4
Automated cherry pick of #8404: fix(notify): add AllOkContactTypes in where permanently enabled and verified ContactType
2020-10-21 10:51:16 +08:00
rainzm
5306add70a feat(notify): add IntelliNotify
IntelliNotify will try to create receiver nonexistent if createReceiver is set to true
2020-10-20 20:38:17 +08:00
rainzm
f367f1abef fix(notify): add AllOkContactTypes in where permanently enabled and verified ContactType 2020-10-20 20:38:17 +08:00
Zexi Li
93dc36134d Merge pull request #8402 from wanyaoqi/automated-cherry-pick-of-#8400-upstream-release-3.4
Automated cherry pick of #8400: fix fetch customize columns
2020-10-20 18:52:56 +08:00
wanyaoqi
f706d59ac5 fix fetch customize columns 2020-10-20 18:43:52 +08:00
Zexi Li
7438bcab23 Merge pull request #8339 from tb365/automated-cherry-pick-of-#8338-upstream-release-3.4
Automated cherry pick of #8338: add aliyun finance environment
2020-10-20 13:33:47 +08:00
yunion-ci-robot
e038eebeb7 Merge pull request #8263 from rainzm/automated-cherry-pick-of-#8258-upstream-release-3.4
Automated cherry pick of #8258: feat: add a retry mechanism to AutoSyncExtDiskSnapshot
2020-10-20 13:31:13 +08:00
Zexi Li
bd7d84aebd Merge pull request #8396 from tb365/automated-cherry-pick-of-#8395-upstream-release-3.4
Automated cherry pick of #8395: lbcert delete bugfix
2020-10-20 13:28:31 +08:00
Zexi Li
5f6f554464 Merge pull request #8398 from zexi/automated-cherry-pick-of-#8397-upstream-release-3.4
Automated cherry pick of #8397: fix: monitor commonalert not detach alert resource
2020-10-20 13:26:51 +08:00
Zexi Li
d99d93d046 fix: monitor commonalert not detach alert resource 2020-10-20 13:21:22 +08:00
Zexi Li
4a856ac688 Merge pull request #8393 from rainzm/automated-cherry-pick-of-#8392-upstream-release-3.4
Automated cherry pick of #8392: fix(region): compute binded disk count when deleting snapshotpolicy
2020-10-20 11:49:52 +08:00
TangBin
7da0a67af5 lbcert delete bugfix 2020-10-20 11:27:53 +08:00
rainzm
37c14d756d feat: use details data to cover obj data in FetchCustomizeColumns 2020-10-20 11:20:45 +08:00
rainzm
6f1417d268 fix(region): compute binded disk count when deleting snapshotpolicy 2020-10-20 11:20:45 +08:00
Zexi Li
b3105a05d3 Merge pull request #8322 from ioito/automated-cherry-pick-of-#8321-upstream-release-3.4
Automated cherry pick of #8321: fix: sync dns records after sync vpcs
2020-10-20 11:19:50 +08:00
rainzm
93ac3260a1 feat: add a retry mechanism to AutoSyncExtDiskSnapshot 2020-10-20 09:54:53 +08:00
yunion-ci-robot
3d39c20c91 Merge pull request #8391 from zhaoxiangchun/automated-cherry-pick-of-#8390-upstream-release-3.4
Automated cherry pick of #8390: bugfix: commonalert
2020-10-19 23:19:23 +08:00
zhaoxiangchun
8a0eeb7d67 bugfix: commonalert
1.报警消息中取消返回sql信息
2.commonalert 中支持top bottom 结构influxdb 查询
2020-10-19 23:06:29 +08:00
yunion-ci-robot
163be04dbb Merge pull request #8364 from zhaoxiangchun/automated-cherry-pick-of-#8357-upstream-release-3.4
Automated cherry pick of #8357: bugfix: qcloud pull metric
2020-10-19 22:34:14 +08:00
zhaoxiangchun
06db7339e4 bugfix: qcloud pull metric
get请求中增加region参数
2020-10-19 22:26:52 +08:00
yunion-ci-robot
e5b3f4673d Merge pull request #8387 from zexi/automated-cherry-pick-of-#8346-upstream-release-3.4
Automated cherry pick of #8346: monitor: add alert resource
2020-10-19 22:13:12 +08:00
yunion-ci-robot
3a6e910580 Merge pull request #8380 from yousong/automated-cherry-pick-of-#8379-upstream-release-3.4
Automated cherry pick of #8379: logger: actionlog: readability change
2020-10-19 22:07:12 +08:00
Zexi Li
0317fad04e Merge pull request #8389 from wanyaoqi/automated-cherry-pick-of-#8388-upstream-release-3.4
Automated cherry pick of #8388: remove try set informer backend
2020-10-19 22:02:39 +08:00
Zexi Li
af11737e79 monitor: add alert resource 2020-10-19 21:48:35 +08:00
wanyaoqi
15bd6bacd6 remove try set informer backend 2020-10-19 21:33:49 +08:00
Zexi Li
28ba60f630 Merge pull request #8386 from wanyaoqi/automated-cherry-pick-of-#8385-upstream-release-3.4
Automated cherry pick of #8385: telegraf-raid-plugin: update raid state to lower case
2020-10-19 21:00:06 +08:00
yunion-ci-robot
8799a0bcf9 Merge pull request #8384 from wanyaoqi/automated-cherry-pick-of-#8383-upstream-release-3.4
Automated cherry pick of #8383: keystone init etcd backend
2020-10-19 20:58:13 +08:00
wanyaoqi
6706c39f85 telegraf-raid-plugin: update raid state to lower case 2020-10-19 20:12:47 +08:00
wanyaoqi
8ce183eaf5 keystone init etcd backend 2020-10-19 20:04:42 +08:00
yunion-ci-robot
a5bec974f1 Merge pull request #8345 from rainzm/automated-cherry-pick-of-#8344-upstream-release-3.4
Automated cherry pick of #8344: feat(notify): support webhook contact type
2020-10-19 18:25:11 +08:00
Zexi Li
ac15981b5d Merge pull request #8377 from swordqiu/automated-cherry-pick-of-#8350-upstream-release-3.4
Automated cherry pick of #8350: fix: missing authenticate action log for user web login
2020-10-19 17:44:44 +08:00
Zexi Li
3c447a32f6 Merge pull request #8342 from swordqiu/automated-cherry-pick-of-#8337-upstream-release-3.4
Automated cherry pick of #8337: fix: cancel pending-delete should increase resource quota usages
2020-10-19 17:44:03 +08:00
yunion-ci-robot
3a8809e060 Merge pull request #8341 from rainzm/automated-cherry-pick-of-#8340-upstream-release-3.4
Automated cherry pick of #8340: feat: add valid filter for cachedimage list
2020-10-19 17:13:11 +08:00
Yousong Zhou
0964c6ad82 logger: actionlog: i18n for distinct-field 2020-10-19 16:42:24 +08:00
Yousong Zhou
5d0fd14cb3 cloudcommon: db: GET: i18n for result of get property calls 2020-10-19 16:42:24 +08:00
Yousong Zhou
cd123e007d cloudcommon: db: add man.GetI18N 2020-10-19 16:42:24 +08:00
Yousong Zhou
91736710ba cloudcommon: db: modelbase: distinct-field: readability change 2020-10-19 16:42:24 +08:00
Yousong Zhou
c2589e7352 logger: actionlog: readability change 2020-10-19 16:42:24 +08:00
rainzm
d454b0a792 feat: add valid filter for cachedimage list
Use the 'valid' switch to control whether to filter out
the cachedimage corresponding to invalid storage
2020-10-19 16:28:04 +08:00
Qiu Jian
2a1a640f6b fix: cancel pending-delete should increase resource quota usages 2020-10-19 16:03:26 +08:00
rainzm
9dee4c1b90 feat(region): call NotifyWebhook in the life cycle of guests 2020-10-19 16:02:55 +08:00
rainzm
0fd6481e4d feat: add NotifyWebhook in notifyclient 2020-10-19 16:02:55 +08:00
rainzm
d799a71fdb feat(notify): allow empty receivers for robot or webhook contact type 2020-10-19 16:02:55 +08:00
rainzm
436f1e5cb9 feat(notify): support webhook contact type 2020-10-19 16:02:55 +08:00
Qiu Jian
a92a0e2d05 fix: missing authenticate action log for user web login 2020-10-19 15:54:10 +08:00
yunion-ci-robot
0cafa996d7 Merge pull request #8362 from swordqiu/automated-cherry-pick-of-#8361-upstream-release-3.4
Automated cherry pick of #8361: fix: do not lock guest after lock eip, to prevent possible dead lock
2020-10-19 15:20:12 +08:00
yunion-ci-robot
2a10b72f98 Merge pull request #8348 from swordqiu/automated-cherry-pick-of-#8347-upstream-release-3.4
Automated cherry pick of #8347: fix: remote update metadata may cause metadata update loop
2020-10-19 15:19:16 +08:00
yunion-ci-robot
31c2b6270a Merge pull request #8354 from swordqiu/automated-cherry-pick-of-#8353-upstream-release-3.4
Automated cherry pick of #8353: fix: reduce change config logs
2020-10-19 15:18:18 +08:00
yunion-ci-robot
a6397d18c2 Merge pull request #8351 from swordqiu/automated-cherry-pick-of-#8350-upstream-release-3.4
Automated cherry pick of #8350: fix: missing authenticate action log for user web login
2020-10-19 15:17:12 +08:00
Zexi Li
203bf44639 Merge pull request #8367 from ioito/automated-cherry-pick-of-#8366-upstream-release-3.4
Automated cherry pick of #8366: fix: add rds cpu and memory usage
2020-10-19 15:11:56 +08:00
Zexi Li
d7a4e52b15 Merge pull request #8374 from ioito/automated-cherry-pick-of-#8373-upstream-release-3.4
Automated cherry pick of #8373: fix: 新增google存储类型
2020-10-19 15:11:08 +08:00
Zexi Li
7946dcef3f Merge pull request #8370 from ioito/automated-cherry-pick-of-#8369-upstream-release-3.4
Automated cherry pick of #8369: fix: use correct worker
2020-10-19 15:10:00 +08:00
Qu Xuan
f77bcd3bbf fix: 新增google存储类型 2020-10-19 14:16:51 +08:00
yunion-ci-robot
4841fbb843 Merge pull request #8356 from wanyaoqi/automated-cherry-pick-of-#8355-upstream-release-3.4
Automated cherry pick of #8355: host: fix sync storage info duration'
2020-10-19 11:57:12 +08:00
Qiu Jian
9b8758e191 fix: reduce change config logs 2020-10-19 11:51:38 +08:00
Qiu Jian
62f5355b11 fix: remote update metadata may cause metadata update loop 2020-10-19 11:46:20 +08:00
Qiu Jian
d774581a23 fix: do not lock guest after lock eip, to prevent possible dead lock 2020-10-19 11:43:22 +08:00
Qu Xuan
062301f54a fix: use correct worker 2020-10-19 11:42:25 +08:00
Qu Xuan
16d13941ce fix: add rds cpu and memory usage 2020-10-19 11:23:21 +08:00
yunion-ci-robot
a10b1945f6 Merge pull request #8359 from yousong/automated-cherry-pick-of-#8358-upstream-release-3.4
Automated cherry pick of #8358: .circleci: build: make with parallel level 2
2020-10-19 10:50:16 +08:00
Yousong Zhou
3aadaf15b7 .circleci: build: make with parallel level 2 2020-10-19 10:29:50 +08:00
wanyaoqi
7a9b491d13 host: fix sync storage info duration' 2020-10-18 01:02:12 +08:00
Qiu Jian
ecbe76e9ff fix: missing authenticate action log for user web login 2020-10-17 22:09:55 +08:00
yunion-ci-robot
41bdfffd57 Merge pull request #8333 from rainzm/automated-cherry-pick-of-#8332-upstream-release-3.4
Automated cherry pick of #8332: feat: support lock storage from selected cachedimage
2020-10-17 18:23:10 +08:00
TangBin
a9c44ed304 add aliyun finance environment 2020-10-17 17:41:57 +08:00
rainzm
7a2c2b8047 refactor: find the most suitable storage 2020-10-17 17:40:08 +08:00
rainzm
a35a6f3c11 feat(esxiagent): try to customize vm if deployfs failed 2020-10-17 17:40:08 +08:00
rainzm
5a7876ae47 feat: support lock storage from selected cachedimage 2020-10-17 17:40:08 +08:00
yunion-ci-robot
31de731cbd Merge pull request #8336 from wanyaoqi/automated-cherry-pick-of-#8325-upstream-release-3.4
Automated cherry pick of #8325: telegraf raid plugin
2020-10-17 11:23:11 +08:00
wanyaoqi
8b2680ed56 telegraf raid plugin 2020-10-17 11:11:30 +08:00
yunion-ci-robot
39c35359aa Merge pull request #8329 from swordqiu/automated-cherry-pick-of-#8304-upstream-release-3.4
Automated cherry pick of #8304: feature: qcloud create VM with tags
2020-10-16 22:19:05 +08:00
Qiu Jian
a764a64696 feature: remote update qcloud instance metadata and name 2020-10-16 21:41:33 +08:00
Qiu Jian
f05a56aadd feature: qcloud create VM with tags 2020-10-16 21:41:33 +08:00
yunion-ci-robot
6cd69d3587 Merge pull request #8335 from rainzm/automated-cherry-pick-of-#8334-upstream-release-3.4
Automated cherry pick of #8334: fix(compute): filter cachedimage with health storage
2020-10-16 19:41:45 +08:00
rainzm
2a1bbfd574 fix(compute): filter cachedimage with health storage 2020-10-16 18:38:44 +08:00
Zexi Li
301006e213 Merge pull request #8331 from ioito/automated-cherry-pick-of-#8330-upstream-release-3.4
Automated cherry pick of #8330: fix: hostname for instance
2020-10-16 17:43:22 +08:00
Qu Xuan
950a2c29fb fix: hostname for instance 2020-10-16 17:12:40 +08:00
yunion-ci-robot
558872db27 Merge pull request #8324 from zhasm/automated-cherry-pick-of-#8323-upstream-release-3.4
Automated cherry pick of #8323: remove alpine build cache before make image
2020-10-16 15:14:46 +08:00
yunion-ci-robot
6386391bf4 Merge pull request #8327 from zexi/automated-cherry-pick-of-#8326-upstream-release-3.4
Automated cherry pick of #8326: fix: get images distinct field
2020-10-16 14:35:40 +08:00
Zexi Li
d298c75448 fix: get images distinct field 2020-10-16 12:01:01 +08:00
Zhang Dongliang
28cb75f41b remove alpine build cache before make image 2020-10-16 12:00:10 +08:00
yunion-ci-robot
560a68d379 Merge pull request #8320 from swordqiu/automated-cherry-pick-of-#8319-upstream-release-3.4
Automated cherry pick of #8319: fix: resolve with_meta filter conflict
2020-10-16 11:39:33 +08:00
Qu Xuan
11f8e4f71f fix: sync dns records after sync vpcs 2020-10-16 11:14:44 +08:00
yunion-ci-robot
9e597db90a Merge pull request #8315 from rainzm/automated-cherry-pick-of-#8314-upstream-release-3.4
Automated cherry pick of #8314: feat(esxi): do not specify portkey in NewVNIC
2020-10-16 10:38:34 +08:00
Qiu Jian
9c9cb17d32 fix: resolve with_meta filter conflict 2020-10-16 10:34:04 +08:00
rainzm
cc96c01c00 feat(esxi): do not specify portkey in NewVNIC 2020-10-16 08:22:58 +08:00
yunion-ci-robot
cb22077722 Merge pull request #8313 from swordqiu/automated-cherry-pick-of-#8312-upstream-release-3.4
Automated cherry pick of #8312: feature: filter storages by image
2020-10-15 23:10:33 +08:00
yunion-ci-robot
8e3c173373 Merge pull request #8309 from ioito/automated-cherry-pick-of-#8308-upstream-release-3.4
Automated cherry pick of #8308: fix: 避免并发同步安全组导致规则混乱
2020-10-15 23:02:32 +08:00
Qiu Jian
45e092bd2d feature: filter storages by image 2020-10-15 22:57:13 +08:00
Qu Xuan
4b2d67de42 fix: 避免并发同步安全组导致规则混乱 2020-10-15 22:26:54 +08:00
yunion-ci-robot
6677c30a5d Merge pull request #8306 from zexi/automated-cherry-pick-of-#8305-upstream-release-3.4
Automated cherry pick of #8305: stringutils2: add RemoveUtf8Strings func
2020-10-15 21:46:36 +08:00
Zexi Li
64593fc882 stringutils2: add RemoveUtf8Strings func 2020-10-15 19:37:00 +08:00
Zexi Li
0d7e1a2517 Merge pull request #8303 from swordqiu/automated-cherry-pick-of-#8302-upstream-release-3.4
Automated cherry pick of #8302: fix: allwo filter resource by with-meta and with-user-meta filter
2020-10-15 15:17:18 +08:00
Zexi Li
6fc835abb9 Merge pull request #8300 from ioito/automated-cherry-pick-of-#8299-upstream-release-3.4
Automated cherry pick of #8299: fix: support filter rds sku by provider
2020-10-15 15:16:04 +08:00
Zexi Li
44a9cc5adb Merge pull request #8293 from lvyangyang/automated-cherry-pick-of-#8289-upstream-release-3.4
Automated cherry pick of #8289: fix:openstack lb 后端ip无法映射到主机的异常处理
2020-10-15 15:15:09 +08:00
Qiu Jian
ff2b7eb345 fix: allwo filter resource by with-meta and with-user-meta filter 2020-10-15 14:46:48 +08:00
Qu Xuan
7b5d822373 fix: support filter rds sku by provider 2020-10-15 14:29:59 +08:00
yunion-ci-robot
f5a45fc16e Merge pull request #8298 from swordqiu/automated-cherry-pick-of-#8297-upstream-release-3.4
Automated cherry pick of #8297: fix: filter role assignments by project domains id or name
2020-10-15 14:24:33 +08:00
yunion-ci-robot
a583bbc74b Merge pull request #8295 from ioito/automated-cherry-pick-of-#8294-upstream-release-3.4
Automated cherry pick of #8294: fix: use new api
2020-10-15 14:22:37 +08:00
yunion-ci-robot
ece82cce42 Merge pull request #8266 from rainzm/automated-cherry-pick-of-#8265-upstream-release-3.4
Automated cherry pick of #8265: feat(esxiagent): sync and use of ESXi template
2020-10-15 13:14:31 +08:00
Qiu Jian
8042b9430c fix: filter project role with system=true 2020-10-15 13:10:54 +08:00
Qiu Jian
d1cbaead09 fix: filter role assignments by project domains id or name 2020-10-15 13:10:54 +08:00
Qu Xuan
1768d1e7db fix: use new api 2020-10-15 11:32:56 +08:00
rainzm
ff34e93862 feat: add 'vlan_id' param when creating network 2020-10-15 10:50:25 +08:00
rainzm
a891d1d876 feat: change templateid as <providerId>/<uuid> in esxi 2020-10-15 10:50:25 +08:00
Rain
c7d6bb7811 fix: support fake tempalte when searching template vm 2020-10-15 10:50:25 +08:00
rainzm
2076a75113 fix(esxiagent): check whether regexp is nil 2020-10-15 10:50:25 +08:00
rainzm
5d0d6d960b feat(esxiagent): keep data disks when cloning vm 2020-10-15 10:50:25 +08:00
lvyangyang
cf89e8a23a fix:openstack lb 后端ip无法映射到主机的异常处理 2020-10-15 10:09:53 +08:00
yunion-ci-robot
45994b59d5 Merge pull request #8291 from ioito/automated-cherry-pick-of-#8290-upstream-release-3.4
Automated cherry pick of #8290: fix: 优化安全组规则同步
2020-10-15 09:10:33 +08:00
Qu Xuan
d2d2934e80 fix: 优化安全组规则同步 2020-10-14 21:19:15 +08:00
yunion-ci-robot
0ec0c8e703 Merge pull request #8286 from lvyangyang/automated-cherry-pick-of-#8275-upstream-release-3.4
Automated cherry pick of #8275: fix:aliyun jsonRequest 增加i/o timeout retry
2020-10-14 17:53:30 +08:00
yunion-ci-robot
3347d6c1e1 Merge pull request #8285 from swordqiu/automated-cherry-pick-of-#8284-upstream-release-3.4
Automated cherry pick of #8284: feature: qcloud create VM with tags
2020-10-14 17:52:29 +08:00
yunion-ci-robot
dce9d5e4a1 Merge pull request #8288 from wanyaoqi/automated-cherry-pick-of-#8287-upstream-release-3.4
Automated cherry pick of #8287: make mode
2020-10-14 16:52:33 +08:00
Qiu Jian
ef9b64990e feature: qcloud create VM with tags 2020-10-14 15:22:30 +08:00
wanyaoqi
f19fe2178c replace NewFloat by NewFloat64 and NewFloat32 2020-10-14 11:56:49 +08:00
wanyaoqi
2265c9422f make mode 2020-10-14 11:56:49 +08:00
yunion-ci-robot
cf3717557a Merge pull request #8282 from ioito/automated-cherry-pick-of-#8281-upstream-release-3.4
Automated cherry pick of #8281: fix: sync huawei bucket project info
2020-10-14 10:51:30 +08:00
yunion-ci-robot
0bbdcb9278 Merge pull request #8280 from ioito/automated-cherry-pick-of-#8264-upstream-release-3.4
Automated cherry pick of #8264: fix: support public ip create
2020-10-14 10:50:30 +08:00
lvyangyang
d72081770e fix:aliyun jsonRequest 增加i/o timeout retry 2020-10-14 10:48:50 +08:00
yunion-ci-robot
0f874d8f07 Merge pull request #8254 from ioito/automated-cherry-pick-of-#8253-upstream-release-3.4
Automated cherry pick of #8253: fix: qcloud eip with bandwidth attr
2020-10-14 10:44:30 +08:00
yunion-ci-robot
dd5dd15a76 Merge pull request #8241 from wanyaoqi/automated-cherry-pick-of-#8231-upstream-release-3.4
Automated cherry pick of #8231: add interface freeze virtual resource
2020-10-14 10:42:30 +08:00
Qu Xuan
cb36572c1c fix: sync huawei bucket project info 2020-10-13 20:55:39 +08:00
Qu Xuan
2a210407a5 fix: support public ip create 2020-10-13 20:01:01 +08:00
Zexi Li
82c59154c5 Merge pull request #8268 from ioito/automated-cherry-pick-of-#8267-upstream-release-3.4
Automated cherry pick of #8267: fix: trans google new region name
2020-10-13 17:34:44 +08:00
Zexi Li
041ee6f904 Merge pull request #8271 from ioito/automated-cherry-pick-of-#8270-upstream-release-3.4
Automated cherry pick of #8270: fix: 支持带宽包用户
2020-10-13 17:34:35 +08:00
yunion-ci-robot
4317fac6da Merge pull request #8279 from wanyaoqi/automated-cherry-pick-of-#8278-upstream-release-3.4
Automated cherry pick of #8278: fix host-deployer base image
2020-10-13 17:04:29 +08:00
yunion-ci-robot
a022f99851 Merge pull request #8277 from zhasm/automated-cherry-pick-of-#8276-upstream-release-3.4
Automated cherry pick of #8276: 在 docker push 脚本里创建_output 目录,以便容错
2020-10-13 17:01:30 +08:00
wanyaoqi
407251975e fix host-deployer base image 2020-10-13 16:59:24 +08:00
Zhang Dongliang
b7fd879e44 在 docker push 脚本里创建_output 目录,以便容错 2020-10-13 16:47:33 +08:00
yunion-ci-robot
0a7ccbe958 Merge pull request #8274 from zhasm/automated-cherry-pick-of-#8273-upstream-release-3.4
Automated cherry pick of #8273: 在 docker push 脚本里创建_output 目录,以便容错
2020-10-13 16:18:31 +08:00
Zhang Dongliang
7efb85ba04 在 docker push 脚本里创建_output 目录,以便容错 2020-10-13 15:37:25 +08:00
Qu Xuan
84e8e4e6c8 fix: 支持带宽包用户 2020-10-13 15:34:03 +08:00
Qu Xuan
3fe15d2675 fix: trans google new region name 2020-10-13 14:18:09 +08:00
Qu Xuan
d574a823ba fix: qcloud eip with bandwidth attr 2020-10-13 10:42:25 +08:00
yunion-ci-robot
a2c8ad13ab Merge pull request #8191 from ioito/automated-cherry-pick-of-#8188-upstream-release-3.4
Automated cherry pick of #8188: fix: avoid qcloud secgroup cache name not sync
2020-10-13 10:41:31 +08:00
yunion-ci-robot
de8f57f625 Merge pull request #8243 from zexi/automated-cherry-pick-of-#8242-upstream-release-3.4
Automated cherry pick of #8242: baremetal: fix pxe filter network by guest_dhcp
2020-10-13 10:32:29 +08:00
Zexi Li
658159b18e Merge pull request #8229 from yousong/automated-cherry-pick-of-#8228-upstream-release-3.4
Automated cherry pick of #8228: eip: construct a pointer type
2020-10-13 10:13:49 +08:00
Zexi Li
67cc7b8747 Merge pull request #8259 from rainzm/automated-cherry-pick-of-#8232-upstream-release-3.4
Automated cherry pick of #8232: fix(esxi): search template from whole vCenter
2020-10-13 10:06:22 +08:00
Zexi Li
ce694ff638 Merge pull request #8247 from swordqiu/automated-cherry-pick-of-#8246-upstream-release-3.4
Automated cherry pick of #8246: fix: project_id in resource details not correct
2020-10-13 10:00:34 +08:00
Zexi Li
98702c2470 Merge pull request #8249 from ioito/automated-cherry-pick-of-#8248-upstream-release-3.4
Automated cherry pick of #8248: fix: qcloud instance with max bandwidth
2020-10-13 09:58:37 +08:00
yunion-ci-robot
9ac5265c07 Merge pull request #8257 from zhasm/automated-cherry-pick-of-#8256-upstream-release-3.4
Automated cherry pick of #8256: 解决编译之后 output 的 owerner 问题
2020-10-12 19:24:28 +08:00
Yousong Zhou
896bec8f43 eip: NewEipForVMOnHost: add opslog 2020-10-12 18:39:17 +08:00
Yousong Zhou
a8426482bf eip: construct a pointer type 2020-10-12 18:39:17 +08:00
Zhang Dongliang
d7316b26aa resolve conflict 2020-10-12 18:12:41 +08:00
rainzm
d16affc9a6 fix(esxi): use system disk of template only when cloning vm
1. Create a driver if necessary.
2. After cloning the virtual machine, remove all data disks.
3. Create new data disks.
2020-10-12 17:46:38 +08:00
rainzm
2259fe1195 fix(esxi): search template from whole vCenter 2020-10-12 17:46:38 +08:00
yunion-ci-robot
09e37de117 Merge pull request #8251 from swordqiu/automated-cherry-pick-of-#8237-upstream-release-3.4
Automated cherry pick of #8237: fix: format errors that block make test
2020-10-12 16:09:22 +08:00
Qu Xuan
715db28e3e fix: qcloud instance with max bandwidth 2020-10-12 15:09:09 +08:00
Qiu Jian
152ea54f36 fix: format errors that block make test 2020-10-12 15:06:44 +08:00
yunion-ci-robot
865b433bb0 Merge pull request #8236 from swordqiu/automated-cherry-pick-of-#8235-upstream-release-3.4
Automated cherry pick of #8235: fix: not clean pending domain usage
2020-10-12 15:04:21 +08:00
yunion-ci-robot
f04a37d0a3 Merge pull request #8233 from rainzm/automated-cherry-pick-of-#8126-upstream-release-3.4
Automated cherry pick of #8126: Feats for ESXi Manage
2020-10-12 15:02:18 +08:00
rainzm
7edcd151e3 feat: add vlanId for suggested network 2020-10-12 14:25:05 +08:00
rainzm
df90d99bc5 feat(esxi): support fake template vm via regex filter 2020-10-12 14:25:05 +08:00
rainzm
552ce3b2ea feat: filter esxi ip by CIDR 2020-10-12 14:25:05 +08:00
rainzm
91c852676a feat(region): make address recommendations more precise
1. 虚拟机的网络推荐不再是一整个C段网络,而是存在的连续IP组成的网段,
这样更准确,用户可以根据自己的需要,合并或者扩充建议的网段
2. 使用 DefaultNetworkGatewayAddressEsxi 来配置子网默认的网关地址。
2020-10-12 14:25:05 +08:00
rainzm
8528d79817 feat: add 'ip-list' for esxicli 2020-10-12 14:25:05 +08:00
Qiu Jian
d2aacafa4c fix: project_id in resource details not correct 2020-10-12 14:20:22 +08:00
yunion-ci-robot
8714503087 Merge pull request #8239 from swordqiu/automated-cherry-pick-of-#8238-upstream-release-3.4
Automated cherry pick of #8238: fix: ldap sync not update user's phone and email
2020-10-12 11:54:19 +08:00
Zexi Li
d0d3d8e333 baremetal: fix pxe filter network by guest_dhcp 2020-10-12 11:36:56 +08:00
wanyaoqi
dee1aa26dc genreate api models 2020-10-12 10:45:50 +08:00
wanyaoqi
c973bf1632 add interface freeze virtual resource 2020-10-12 10:45:50 +08:00
Qiu Jian
1aa82ae950 fix: ldap sync not update user's phone and email 2020-10-11 05:44:53 +08:00
Qiu Jian
488e7e56a6 fix: not clean pending domain usage 2020-10-11 04:37:04 +08:00
yunion-ci-robot
6a2ebdc123 Merge pull request #8195 from rainzm/automated-cherry-pick-of-#8194-upstream-release-3.4
Automated cherry pick of #8194: fix(esxi): check nil value when NewVirtualMachine
2020-10-10 19:10:17 +08:00
yunion-ci-robot
4105284718 Merge pull request #8217 from tb365/automated-cherry-pick-of-#8214-upstream-release-3.4
Automated cherry pick of #8214: remove aws lbbg cache metedata
2020-10-10 18:55:20 +08:00
yunion-ci-robot
ac5f29bc0c Merge pull request #8226 from zhaoxiangchun/automated-cherry-pick-of-#8213-upstream-release-3.4
Automated cherry pick of #8213: bugfix:scoperesource FilterByOwner
2020-10-10 17:11:18 +08:00
zhaoxiangchun
58d52d947c Add web url to alarm template 2020-10-10 16:24:29 +08:00
zhaoxiangchun
c5ef564d35 bugfix:scoperesource FilterByOwner
1.调度标签 和 优化建议 FilterByOwner 逻辑调整
2020-10-10 16:24:29 +08:00
yunion-ci-robot
1cacf1068f Merge pull request #8219 from yousong/automated-cherry-pick-of-#8218-upstream-release-3.4
Automated cherry pick of #8218: webconsole: ssh: each argument on its own line
2020-10-10 15:34:49 +08:00
Yousong Zhou
63b0d0c071 webconsole: ssh: add keyboard-interactive as an option
For ESXi 6.0

  Authentications that can continue: publickey,keyboard-interactive
2020-10-10 14:43:39 +08:00
Yousong Zhou
39a45229af webconsole: ssh: each argument on its own line 2020-10-10 14:43:39 +08:00
TangBin
e82cf184f1 remove aws lbbg cache metedata 2020-10-10 14:28:27 +08:00
yunion-ci-robot
afa16944c0 Merge pull request #8211 from ioito/automated-cherry-pick-of-#8210-upstream-release-3.4
Automated cherry pick of #8210: fix: validate secgroup purge condition
2020-10-10 14:02:15 +08:00
yunion-ci-robot
8f953e41da Merge pull request #8200 from rainzm/automated-cherry-pick-of-#8199-upstream-release-3.4
Automated cherry pick of #8199: fix(esxi): check whether some fields of vm are nil
2020-10-10 12:53:09 +08:00
yunion-ci-robot
6e0180656d Merge pull request #8208 from ioito/automated-cherry-pick-of-#8207-upstream-release-3.4
Automated cherry pick of #8207: fix: qcloud set hostname for instance
2020-10-10 12:08:09 +08:00
yunion-ci-robot
718bf0d537 Merge pull request #8184 from yousong/automated-cherry-pick-of-#8183-upstream-release-3.4
Automated cherry pick of #8183: vpcagent: ovn: increase dhcp lease, renew, rebind time
2020-10-10 11:56:13 +08:00
Qu Xuan
9fbd4f0599 fix: validate secgroup purge condition 2020-10-10 11:54:38 +08:00
rainzm
078b1d635a fix: avoid slice out of bounds 2020-10-10 11:52:06 +08:00
rainzm
b8e0599e3f fix(esxi): filter linkLocalAddress 2020-10-10 11:52:06 +08:00
rainzm
27bd564d2d fix(esxi): check whether some fields of vm are nil 2020-10-10 11:52:06 +08:00
Qu Xuan
5b79ba5607 fix: qcloud set hostname for instance 2020-10-10 11:41:15 +08:00
yunion-ci-robot
c9d20d13f1 Merge pull request #8206 from swordqiu/automated-cherry-pick-of-#8205-upstream-release-3.4
Automated cherry pick of #8205: fix: filter cached images with host schedtag
2020-10-10 11:35:09 +08:00
yunion-ci-robot
779d4a9acf Merge pull request #8203 from swordqiu/automated-cherry-pick-of-#8202-upstream-release-3.4
Automated cherry pick of #8202: fix: server name auto index should start from 1
2020-10-10 11:35:04 +08:00
rainzm
1bc4b3cb90 fix(esxi): check nil value when NewVirtualMachine 2020-10-10 11:24:12 +08:00
Qiu Jian
49887e540a fix: filter cached images with host schedtag 2020-10-10 06:57:57 +08:00
Qiu Jian
7ce0d7b44b fix: server name auto index should start from 1 2020-10-10 06:26:31 +08:00
Qu Xuan
e8d737ff6c fix: avoid qcloud secgroup cache name not sync 2020-10-09 14:58:10 +08:00
yunion-ci-robot
fd954efcf2 Merge pull request #8177 from zhaoxiangchun/automated-cherry-pick-of-#8176-upstream-release-3.4
Automated cherry pick of #8176: modify suggest rule cli
2020-10-09 10:35:01 +08:00
Yousong Zhou
e9415ae49e vpcagent: ovn: increase dhcp lease, renew, rebind time 2020-10-09 10:24:55 +08:00
yunion-ci-robot
5b0afbdc6b Merge pull request #8179 from swordqiu/automated-cherry-pick-of-#8178-upstream-release-3.4
Automated cherry pick of #8178: fix: error code of external bucket not found error should be 404
2020-10-09 09:13:00 +08:00
yunion-ci-robot
ec393a6e3c Merge pull request #8182 from swordqiu/automated-cherry-pick-of-#8181-upstream-release-3.4
Automated cherry pick of #8181: hotfix: 1. allow merge networks without continuous addresses 2. filter guest_ip_start and guest_ip_end with contains operator
2020-10-09 09:09:00 +08:00
Qiu Jian
adccad3487 hotfix: 1. allow merge networks without continuous addresses 2. filter guest_ip_start and guest_ip_end with contains operator 2020-10-07 23:32:32 +08:00
Qiu Jian
76f794d1a2 fix: error code of external bucket not found error should be 404 2020-09-30 18:01:44 +08:00
zhaoxiangchun
bba2cf23fd modify suggest rule cli
1.增加perform config方法,方便修改默认规则:执行周期,扫描窗口的属性
2020-09-30 17:18:18 +08:00
yunion-ci-robot
b8f8c3bae4 Merge pull request #8174 from yousong/automated-cherry-pick-of-#8173-upstream-release-3.4
Automated cherry pick of #8173: dns: isMyDomain: match only strict subdomain of dns_domain
2020-09-30 16:31:49 +08:00
yunion-ci-robot
7f3c0103d0 Merge pull request #8167 from lvyangyang/automated-cherry-pick-of-#8153-upstream-release-3.4
Automated cherry pick of #8153: fix:允许cname record通过policy多值
2020-09-30 16:30:46 +08:00
yunion-ci-robot
499ddeba32 Merge pull request #8169 from swordqiu/automated-cherry-pick-of-#8168-upstream-release-3.4
Automated cherry pick of #8168: fix: emulated wire not sync vpc shared info
2020-09-30 16:17:47 +08:00
Yousong Zhou
7e191a503c dns: isMyDomain: match only strict subdomain of dns_domain 2020-09-30 16:15:59 +08:00
yunion-ci-robot
94eb72fb3c Merge pull request #8172 from ioito/automated-cherry-pick-of-#8171-upstream-release-3.4
Automated cherry pick of #8171: fix: 允许域管理员可以看到共享的dns zone cache列表
2020-09-30 16:13:47 +08:00
Qu Xuan
02bcce195c fix: 允许域管理员可以看到共享的dns zone cache列表 2020-09-30 15:57:51 +08:00
Qiu Jian
5c4423bcbe fix: emulated wire not sync vpc shared info 2020-09-30 15:54:34 +08:00
lvyangyang
9b7fbf33b8 fix:允许cname record通过policy多值 2020-09-30 15:50:13 +08:00
yunion-ci-robot
a7a8ad1931 Merge pull request #8164 from swordqiu/automated-cherry-pick-of-#8163-upstream-release-3.4
Automated cherry pick of #8163: fix: oidc response user's info
2020-09-30 12:11:46 +08:00
yunion-ci-robot
6c8b30e1be Merge pull request #8166 from swordqiu/automated-cherry-pick-of-#8165-upstream-release-3.4
Automated cherry pick of #8165: fix: revert filter-by-owner changes of scoped resource
2020-09-30 12:07:51 +08:00
Qiu Jian
8cdab93c15 fix: oidc response user's info 2020-09-30 11:57:21 +08:00
Qiu Jian
8a28d26271 fix: revert filter-by-owner changes of scoped resource 2020-09-30 11:34:56 +08:00
yunion-ci-robot
29fa258c6e Merge pull request #8162 from tb365/automated-cherry-pick-of-#8159-upstream-release-3.4
Automated cherry pick of #8159: aliyun public elb region fix
2020-09-29 23:28:41 +08:00
TangBin
7a61d77b06 aliyun public elb region fix 2020-09-29 22:05:47 +08:00
yunion-ci-robot
552dd2bfd1 Merge pull request #8148 from lvyangyang/automated-cherry-pick-of-#8145-upstream-release-3.4
Automated cherry pick of #8145: fix:forbid top level public domain name
2020-09-29 20:21:36 +08:00
yunion-ci-robot
60c42975a8 Merge pull request #8158 from zhaoxiangchun/automated-cherry-pick-of-#8076-upstream-release-3.4
Automated cherry pick of #8076: bugfix:commonalert
2020-09-29 19:17:34 +08:00
yunion-ci-robot
ad53ddd84b Merge pull request #8157 from tb365/automated-cherry-pick-of-#8154-upstream-release-3.4
Automated cherry pick of #8154: aliyun public elb brand fix
2020-09-29 18:19:33 +08:00
zhaoxiangchun
e87d2c0e86 bugfix commalert 3.4
1.后端先隐藏rds,redis,oss等相关信息
2.报警通知中规则描述增加单位信息
3.调整优化建议规则相关逻辑
2020-09-29 18:14:05 +08:00
zhaoxiangchun
a9c95cf363 bugfix:commonalert
1.suggestrule cli 调整
2020-09-29 18:14:05 +08:00
TangBin
540f4631f4 aliyun public elb brand fix 2020-09-29 16:49:41 +08:00
yunion-ci-robot
6db3ec81ea Merge pull request #8150 from ioito/automated-cherry-pick-of-#8149-upstream-release-3.4
Automated cherry pick of #8149: fix: allow domain admin view shared dns zone records
2020-09-29 12:23:33 +08:00
yunion-ci-robot
abc2be7e5e Merge pull request #8147 from ioito/automated-cherry-pick-of-#8146-upstream-release-3.4
Automated cherry pick of #8146: fix: avoid sync dns zone cache status is init
2020-09-29 12:20:34 +08:00
Qu Xuan
b0e1d0de23 fix: allow domain admin view shared dns zone records 2020-09-29 11:20:35 +08:00
lvyangyang
fba8349e84 fix:forbid top level public domain name 2020-09-29 11:04:10 +08:00
yunion-ci-robot
9bd70e3cb6 Merge pull request #8102 from rainzm/automated-cherry-pick-of-#8101-upstream-release-3.4
Automated cherry pick of #8101: fix(region): set ownerId as userCred when can't FetchOwnerId
2020-09-29 10:41:39 +08:00
Qu Xuan
f931deb41f fix: avoid sync dns zone cache status is init 2020-09-29 10:39:54 +08:00
yunion-ci-robot
324e7435ac Merge pull request #8144 from zexi/automated-cherry-pick-of-#8143-upstream-release-3.4
Automated cherry pick of #8143: mcclient modules: fix k8s fed rolebinding joint wrong resource manager
2020-09-29 10:35:36 +08:00
Zexi Li
1a1d7c70ad mcclient modules: fix k8s fed rolebinding joint wrong resource manager 2020-09-29 08:28:05 +08:00
yunion-ci-robot
3a773f87d3 Merge pull request #8142 from swordqiu/automated-cherry-pick-of-#8141-upstream-release-3.4
Automated cherry pick of #8141: fix: filter storages by host schedtag
2020-09-29 01:20:35 +08:00
Qiu Jian
11ea89795a fix: filter storages by host schedtag 2020-09-29 00:20:26 +08:00
yunion-ci-robot
288b9e02af Merge pull request #8140 from zhaoxiangchun/automated-cherry-pick-of-#8139-upstream-release-3.4
Automated cherry pick of #8139: bugfix :esxi 多机器环境下拉取监控超时
2020-09-28 18:27:33 +08:00
zhaoxiangchun
b88c114ba6 bugfix :esxi 多机器环境下拉取监控超时
1.简化mo.virtualMachine 实体中的属性
2.批量获取cloudprovider下所有的虚拟机的监控信息
2020-09-28 18:13:27 +08:00
Zexi Li
aa3ff8ac5b Merge pull request #8138 from zexi/automated-cherry-pick-of-#8137-upstream-release-3.4
Automated cherry pick of #8137: region: host specs replace space char to '_'
2020-09-28 17:46:58 +08:00
Zexi Li
3b0ba2caa9 region: host specs replace space char to '_' 2020-09-28 17:38:54 +08:00
Zexi Li
4dff79bdd0 Merge pull request #8136 from zexi/automated-cherry-pick-of-#8135-upstream-release-3.4
Automated cherry pick of #8135: specs: fix specKey url not escape
2020-09-28 17:01:44 +08:00
Zexi Li
a4d7b2b4b3 specs: fix specKey url not escape 2020-09-28 16:55:56 +08:00
yunion-ci-robot
f2b0fa1911 Merge pull request #8134 from rainzm/automated-cherry-pick-of-#8133-upstream-release-3.4
Automated cherry pick of #8133: fix(scheduler): filter InstanceGroup whose enabled is false
2020-09-28 16:40:35 +08:00
yunion-ci-robot
c1a963801f Merge pull request #8128 from lvyangyang/automated-cherry-pick-of-#8086-upstream-release-3.4
Automated cherry pick of #8086: fix:/dnsrecordset重复检查,dnszonevpc数量
2020-09-28 16:30:33 +08:00
yunion-ci-robot
95456e3e08 Merge pull request #8124 from rainzm/automated-cherry-pick-of-#8123-upstream-release-3.4
Automated cherry pick of #8123: fix: suffix template cache key
2020-09-28 16:28:35 +08:00
Zexi Li
41c84ca8ec Merge pull request #8132 from tb365/automated-cherry-pick-of-#8129-upstream-release-3.4
Automated cherry pick of #8129: aliyun create public lb fix
2020-09-28 16:24:36 +08:00
Rain
e6de7be7e1 fix(scheduler): filter InstanceGroup whose enabled is false 2020-09-28 16:06:17 +08:00
TangBin
3ddce26aa0 aliyun create public lb fix 2020-09-28 14:20:57 +08:00
lvyangyang
d94e55501a fix:/dnsrecordset重复检查,dnszonevpc数量 2020-09-28 11:08:41 +08:00
yunion-ci-robot
a9ca6e0a8a Merge pull request #8122 from zexi/automated-cherry-pick-of-#8121-upstream-release-3.4
Automated cherry pick of #8121: region: fix query object by spec not include details
2020-09-27 22:10:35 +08:00
rainzm
ad22483113 fix: suffix template cache key 2020-09-27 21:10:03 +08:00
yunion-ci-robot
4e9af39d73 Merge pull request #8117 from wanyaoqi/automated-cherry-pick-of-#8116-upstream-release-3.4
Automated cherry pick of #8116: umount nfs on detach storage
2020-09-27 21:03:37 +08:00
Zexi Li
a05f50dbf0 region: fix query object by spec not include details 2020-09-27 20:48:47 +08:00
wanyaoqi
adbe292f48 increase rbd check timeout 2020-09-27 20:19:50 +08:00
wanyaoqi
61cc180101 umount nfs on detach storage 2020-09-27 20:19:50 +08:00
yunion-ci-robot
1fd043c99b Merge pull request #8115 from swordqiu/automated-cherry-pick-of-#8114-upstream-release-3.4
Automated cherry pick of #8114: fix: filter cloudprovider/network by host-schedtag-id
2020-09-27 19:56:38 +08:00
Qiu Jian
82c0dcfb38 fix: filter cloudprovider/network by host-schedtag-id 2020-09-27 18:30:36 +08:00
yunion-ci-robot
ea5fbef0c2 Merge pull request #8111 from ioito/automated-cherry-pick-of-#8110-upstream-release-3.4
Automated cherry pick of #8110: fix: dns zone cache owner info
2020-09-27 16:51:34 +08:00
yunion-ci-robot
c1d66fc4e7 Merge pull request #8094 from tb365/automated-cherry-pick-of-#8087-upstream-release-3.4
Automated cherry pick of #8087: huawei snapshot delete fix
2020-09-27 15:11:32 +08:00
Zexi Li
b7423baf1f Merge pull request #8085 from ioito/automated-cherry-pick-of-#8084-upstream-release-3.4
Automated cherry pick of #8084: fix: openstack zone not emulated
2020-09-27 14:46:55 +08:00
Zexi Li
0ca3349d58 Merge pull request #8089 from wanyaoqi/automated-cherry-pick-of-#8088-upstream-release-3.4
Automated cherry pick of #8088: set stagefail on clean fail
2020-09-27 14:46:00 +08:00
yunion-ci-robot
8dde6a6ac4 Merge pull request #8100 from rainzm/automated-cherry-pick-of-#8099-upstream-release-3.4
Automated cherry pick of #8099: fix(esxi): Guarantee the uniqueness of the schedtag for esxi host
2020-09-27 14:45:34 +08:00
yunion-ci-robot
0d2d5b0728 Merge pull request #8108 from ioito/automated-cherry-pick-of-#8107-upstream-release-3.4
Automated cherry pick of #8107: fix: allow create disk prefer manager
2020-09-27 14:44:35 +08:00
Qu Xuan
da8529a00a fix: dns zone cache owner info 2020-09-27 14:35:49 +08:00
Qu Xuan
73aee11474 fix: allow create disk prefer manager 2020-09-27 14:18:44 +08:00
yunion-ci-robot
5229c06dfc Merge pull request #8060 from ioito/automated-cherry-pick-of-#8059-upstream-release-3.4
Automated cherry pick of #8059: fix: avoid serial vm creation
2020-09-26 23:18:33 +08:00
yunion-ci-robot
37b2b30af5 Merge pull request #8105 from zexi/automated-cherry-pick-of-#8104-upstream-release-3.4
Automated cherry pick of #8104: region: fix schedtag joint resource master/slave field wrong order
2020-09-26 08:48:31 +08:00
Zexi Li
7baaf23f84 Merge pull request #8096 from ioito/automated-cherry-pick-of-#8095-upstream-release-3.4
Automated cherry pick of #8095: fix: avoid purge storages
2020-09-25 20:54:42 +08:00
Zexi Li
1b6ac9bc48 region: fix schedtag joint resource master/slave field wrong order 2020-09-25 20:50:49 +08:00
rainzm
1215d723af fix(region): set ownerId as userCred when can't FetchOwnerId 2020-09-25 20:38:23 +08:00
rainzm
4586c82cb2 fix:(region) correct syncSchedtags
1.把extTagName存到metadata里面,这样就算修改tag的name,也能在metadata里面拿到。
2.已经创建的schedtag就不要重复创建了。
2020-09-25 20:28:27 +08:00
rainzm
5460f22444 fix(esxi): Guarantee the uniqueness of the schedtag for esxi host
Replace 'cluster:<clustername>' with
'cluster:/<cloudprovidername>/<dcname>/<clustername>'.
2020-09-25 20:28:27 +08:00
Qu Xuan
f5cf093e0f fix: avoid purge storages 2020-09-25 19:16:21 +08:00
TangBin
77865d894e huawei client request add throttling control 2020-09-25 19:07:41 +08:00
TangBin
454aabca75 huawei elb get params log 2020-09-25 19:07:41 +08:00
TangBin
c6d2149914 qcloud elb create listener fix 2020-09-25 19:07:41 +08:00
TangBin
ebee608109 huawei snapshot delete fix 2020-09-25 19:07:41 +08:00
wanyaoqi
7e2e7ade19 set stagefail on clean fail 2020-09-25 18:42:57 +08:00
Zexi Li
5d39338d60 Merge pull request #8083 from ioito/automated-cherry-pick-of-#8075-upstream-release-3.4
Automated cherry pick of #8075: fix: allow cross doamin resource sync
2020-09-25 16:56:36 +08:00
ioito
3903af786b fix: openstack zone not emulated 2020-09-25 16:15:34 +08:00
ioito
91cac5c217 fix: allow cross doamin resource sync 2020-09-25 15:49:57 +08:00
Zexi Li
12ef953b70 Merge pull request #8078 from ioito/automated-cherry-pick-of-#8077-upstream-release-3.4
Automated cherry pick of #8077: fix: avoid account delete failed
2020-09-25 12:11:43 +08:00
Zexi Li
d029dc22c0 Merge pull request #8018 from rainzm/automated-cherry-pick-of-#8017-upstream-release-3.4
Automated cherry pick of #8017: refactor(region): replace 'ActualCapacity' with 'ActualCapacityUsed'
2020-09-25 12:08:29 +08:00
Zexi Li
0deb8ea928 Merge pull request #8055 from rainzm/automated-cherry-pick-of-#8054-upstream-release-3.4
Automated cherry pick of #8054: feat: add GetSchedtags for ICloudHost
2020-09-25 12:07:13 +08:00
Zexi Li
1ffa6f5295 Merge pull request #8081 from zexi/automated-cherry-pick-of-#8080-upstream-release-3.4
Automated cherry pick of #8080: climc: add k8s fed resource sync action
2020-09-25 12:06:18 +08:00
Zexi Li
37b9a2e53d climc: add k8s fed resource sync action 2020-09-25 11:52:20 +08:00
yunion-ci-robot
f6a620ac46 Merge pull request #8067 from lvyangyang/automated-cherry-pick-of-#8002-upstream-release-3.4
Automated cherry pick of #8002: wait deleted
2020-09-25 11:13:30 +08:00
ioito
5f50314df6 fix: avoid account delete failed 2020-09-25 10:54:25 +08:00
rainzm
9ded6e43f1 feat(region): sync capacityUsed for storage after deploying or deleting guest 2020-09-25 10:35:01 +08:00
rainzm
547b2960b1 feat(region): sync CapacityUsed for Storage 2020-09-25 10:35:01 +08:00
rainzm
116d347c88 feat: add GetCapacityUsedMB for ICloudStorage 2020-09-25 10:35:01 +08:00
rainzm
e0c94daaf7 refactor(region): replace 'ActualCapacity' with 'ActualCapacityUsed' 2020-09-25 10:35:01 +08:00
rainzm
679ccb825a feat(region): sync schedtags when syncing host 2020-09-25 10:31:49 +08:00
rainzm
857e76ab78 feat(esxi): add GetSchedtags implementation for esxi.SHost 2020-09-25 10:31:49 +08:00
rainzm
0d05f9ee18 feat: add GetSchedtags for ICloudHost 2020-09-25 10:31:49 +08:00
Zexi Li
7e362cae3d Merge pull request #8057 from ioito/automated-cherry-pick-of-#8056-upstream-release-3.4
Automated cherry pick of #8056: fix: 仅在可用区故障时可强制挂载磁盘
2020-09-25 01:40:52 +08:00
Zexi Li
54ee77db03 Merge pull request #8066 from lvyangyang/automated-cherry-pick-of-#8013-upstream-release-3.4
Automated cherry pick of #8013: fix: dns 错误信息补全
2020-09-25 01:39:40 +08:00
Zexi Li
95b82d299d Merge pull request #8069 from ioito/automated-cherry-pick-of-#8068-upstream-release-3.4
Automated cherry pick of #8068: fix: avoid compare err with cloudprovider.ErrNotFound direct
2020-09-25 01:38:22 +08:00
Zexi Li
e4605d8c3b Merge pull request #8064 from rainzm/automated-cherry-pick-of-#8063-upstream-release-3.4
Automated cherry pick of #8063: fix(region): fetch correct ownerId in PerformPrepareNets
2020-09-24 21:22:00 +08:00
Zexi Li
652eb65252 Merge pull request #8072 from ioito/automated-cherry-pick-of-#8071-upstream-release-3.4
Automated cherry pick of #8071: fix: sql err
2020-09-24 21:19:26 +08:00
ioito
310baa266b fix: sql err 2020-09-24 20:22:39 +08:00
ioito
5f2c771f73 fix: avoid compare err with cloudprovider.ErrNotFound direct 2020-09-24 20:15:48 +08:00
lvyangyang
d90b661f7e wait deleted 2020-09-24 17:40:21 +08:00
lvyangyang
8d28bfc6d2 fix: dns 错误信息补全 2020-09-24 17:36:58 +08:00
rainzm
c7b8e84ffe fix(region): fetch correct ownerId in PerformPrepareNets 2020-09-24 17:26:17 +08:00
ioito
b5088230bf fix: avoid serial vm creation 2020-09-24 16:41:02 +08:00
ioito
4038bfb8a1 fix: 仅在可用区故障时可强制挂载磁盘 2020-09-24 15:39:09 +08:00
yunion-ci-robot
afb8924762 Merge pull request #8050 from zexi/automated-cherry-pick-of-#8049-upstream-release-3.4
Automated cherry pick of #8049: climc: refactor k8s sub command
2020-09-24 10:59:19 +08:00
yunion-ci-robot
796c3d1d48 Merge pull request #8008 from rainzm/automated-cherry-pick-of-#8007-upstream-release-3.4
Automated cherry pick of #8007: Fix & Feat of Notify or Lang
2020-09-24 10:43:19 +08:00
yunion-ci-robot
57a2258d94 Merge pull request #8053 from zhaoxiangchun/automated-cherry-pick-of-#8051-upstream-release-3.4
Automated cherry pick of #8051: commonalert bugfix 3.4
2020-09-24 10:24:20 +08:00
zhaoxiangchun
365e555c98 commonalert bugfix 3.4 2020-09-24 10:20:58 +08:00
Zexi Li
63603359e7 Merge pull request #8046 from ioito/automated-cherry-pick-of-#8029-upstream-release-3.4
Automated cherry pick of #8029: fix: avoid account delete failed
2020-09-23 23:51:44 +08:00
Zexi Li
fc3b794515 Merge pull request #8052 from swordqiu/automated-cherry-pick-of-#8048-upstream-release-3.4
Automated cherry pick of #8048: fix: scope resource filter by owner
2020-09-23 23:49:38 +08:00
Zexi Li
51020aac04 climc: refactor k8s sub command 2020-09-23 23:43:55 +08:00
yunion-ci-robot
32470e2ad3 Merge pull request #8032 from wanyaoqi/automated-cherry-pick-of-#8031-upstream-release-3.4
Automated cherry pick of #8031: support mutli params
2020-09-23 23:13:23 +08:00
Qiu Jian
975e7fb1e8 fix: scope resource filter by owner 2020-09-23 22:58:52 +08:00
rainzm
1c786a034b fix: use i18n.Table to handle Chinese-English conversion 2020-09-23 21:26:35 +08:00
rainzm
2d5055c908 feat: log err when sending notification via notifyclient 2020-09-23 21:26:35 +08:00
rainzm
471e2b4f13 fix(region): split brand as 'YunionCloud' and '云联壹云' when notify server event 2020-09-23 21:26:35 +08:00
rainzm
8da2d5ff7a feat: inherit lang from ctx fro Task 2020-09-23 21:26:35 +08:00
rainzm
043fdcfec2 fix(notify): modify name of notification to avoid duplication 2020-09-23 21:26:35 +08:00
rainzm
09bebcf5f4 fix(notify): clean verifyNote when mark verified 2020-09-23 21:26:35 +08:00
rainzm
d917e8e386 fix(notify): return correct value when sortContactType 2020-09-23 21:26:35 +08:00
yunion-ci-robot
7d163f63a1 Merge pull request #8025 from swordqiu/automated-cherry-pick-of-#8024-upstream-release-3.4
Automated cherry pick of #8024: fix: apigateway userinfo includes project metadata
2020-09-23 21:24:25 +08:00
yunion-ci-robot
8ce445487b Merge pull request #8015 from wanyaoqi/automated-cherry-pick-of-#8014-upstream-release-3.4
Automated cherry pick of #8014: support search ip
2020-09-23 21:22:21 +08:00
Zexi Li
6cff31add6 Merge pull request #8012 from ioito/automated-cherry-pick-of-#8011-upstream-release-3.4
Automated cherry pick of #8011: fix: 避免添加新账号后长时间未同步iam用户
2020-09-23 21:10:26 +08:00
Zexi Li
7698dcf506 Merge pull request #8010 from ioito/automated-cherry-pick-of-#8009-upstream-release-3.4
Automated cherry pick of #8009: fix: 优化提取显示主账号名
2020-09-23 21:08:35 +08:00
yunion-ci-robot
a7e537f4df Merge pull request #8045 from lvyangyang/automated-cherry-pick-of-#8044-upstream-release-3.4
Automated cherry pick of #8044: fix: error 值重叠
2020-09-23 21:08:22 +08:00
yunion-ci-robot
d23ffbb997 Merge pull request #8035 from swordqiu/automated-cherry-pick-of-#8034-upstream-release-3.4
Automated cherry pick of #8034: fix: role assignment filter by users not working for effective users in groups
2020-09-23 20:59:20 +08:00
ioito
c38cb271f8 fix: avoid account delete failed 2020-09-23 20:58:41 +08:00
yunion-ci-robot
c4c07c4e9d Merge pull request #8033 from yousong/automated-cherry-pick-of-#8030-upstream-release-3.4
Automated cherry pick of #8030: monitor: error fmt
2020-09-23 20:56:19 +08:00
yunion-ci-robot
682fa5e5bd Merge pull request #8037 from rainzm/automated-cherry-pick-of-#8036-upstream-release-3.4
Automated cherry pick of #8036: fix(region): add GetSlaveFieldName for ScalingGroupGuest
2020-09-23 20:52:19 +08:00
yunion-ci-robot
cefe057dc8 Merge pull request #8027 from ioito/automated-cherry-pick-of-#8026-upstream-release-3.4
Automated cherry pick of #8026: fix: 避免腾讯云同步虚拟机ip异常
2020-09-23 20:51:31 +08:00
yunion-ci-robot
1026b74e65 Merge pull request #8042 from zhaoxiangchun/automated-cherry-pick-of-#8041-upstream-release-3.4
Automated cherry pick of #8041: bugfix:esxi collect metric
2020-09-23 20:42:20 +08:00
yunion-ci-robot
ccce0a4be5 Merge pull request #8040 from zhasm/automated-cherry-pick-of-#8039-upstream-release-3.4
Automated cherry pick of #8039: fix esxi-agent dockerfile typo
2020-09-23 20:41:20 +08:00
lvyangyang
9a04238b77 fix: error 值重叠 2020-09-23 20:11:25 +08:00
zhaoxiangchun
a7198dc21b bugfix:esxi collect metric 2020-09-23 19:49:28 +08:00
Zhang Dongliang
78fc35d3a6 fix esxi-agent dockerfile typo 2020-09-23 18:56:28 +08:00
Yousong Zhou
70fd9dfb70 locales: monitor: add translations 2020-09-23 18:43:17 +08:00
Yousong Zhou
572e45968d monitor: error fmt 2020-09-23 18:43:17 +08:00
rainzm
35842df1bd fix(region): add GetSlaveFieldName for ScalingGroupGuest 2020-09-23 18:39:16 +08:00
Qiu Jian
b32eddce03 fix: role assignment filter by users not working for effective users in groups 2020-09-23 18:31:00 +08:00
wanyaoqi
8102e7ed00 support mutli params 2020-09-23 18:25:06 +08:00
ioito
f659ccd0d5 fix: 避免腾讯云同步虚拟机ip异常 2020-09-23 18:17:36 +08:00
yunion-ci-robot
27fe6bc38d Merge pull request #8022 from yousong/automated-cherry-pick-of-#8021-upstream-release-3.4
Automated cherry pick of #8021: elasticips: fix calling FilterByOwner
2020-09-23 17:27:19 +08:00
yunion-ci-robot
b118f341bc Merge pull request #8020 from zhasm/automated-cherry-pick-of-#8019-upstream-release-3.4
Automated cherry pick of #8019: make with ARCH argument
2020-09-23 16:38:18 +08:00
Yousong Zhou
59a5e9201e elasticips: error when we have no usable eip network 2020-09-23 16:22:49 +08:00
Yousong Zhou
430e9cd0fc elasticips: fix calling FilterByOwner 2020-09-23 16:22:49 +08:00
Qiu Jian
5b6b5eeb7d fix: apigateway userinfo includes project metadata 2020-09-23 16:07:00 +08:00
Zhang Dongliang
384e866649 make with ARCH argument 2020-09-23 15:57:49 +08:00
wanyaoqi
884e82a150 support search ip 2020-09-23 14:26:43 +08:00
ioito
b3c235fe30 fix: 避免添加新账号后长时间未同步iam用户 2020-09-23 10:34:04 +08:00
ioito
686df64ea9 fix: 优化提取显示主账号名 2020-09-22 21:24:33 +08:00
yunion-ci-robot
d8fa8a49fb Merge pull request #8006 from tb365/automated-cherry-pick-of-#8003-upstream-release-3.4
Automated cherry pick of #8003: regional network filter bugfix
2020-09-22 21:18:23 +08:00
yunion-ci-robot
1afeca5687 Merge pull request #8001 from ioito/automated-cherry-pick-of-#7990-upstream-release-3.4
Automated cherry pick of #7990: fix: avoid not reture cloudprovider.ErrNotFound error
2020-09-22 21:12:18 +08:00
yunion-ci-robot
304457a3b4 Merge pull request #7999 from ioito/automated-cherry-pick-of-#7998-upstream-release-3.4
Automated cherry pick of #7998: optimized: create eip params
2020-09-22 21:10:18 +08:00
TangBin
0bba6e63f0 regional network filter bugfix 2020-09-22 20:06:48 +08:00
Qu Xuan
bb3317cc32 fix: avoid not reture cloudprovider.ErrNotFound error 2020-09-22 16:49:38 +08:00
Qu Xuan
becf92f6bf optimized: create eip params 2020-09-22 16:47:42 +08:00
yunion-ci-robot
632ab6c2f9 Merge pull request #7987 from zhaoxiangchun/automated-cherry-pick-of-#7986-upstream-release-3.4
Automated cherry pick of #7986: common alert bugfix/3.4
2020-09-22 14:40:18 +08:00
yunion-ci-robot
cb0b0bea41 Merge pull request #7992 from zhaoxiangchun/automated-cherry-pick-of-#7991-upstream-release-3.4
Automated cherry pick of #7991: bugfix: collect esxi metric timout
2020-09-22 14:16:20 +08:00
yunion-ci-robot
6f324b0ea1 Merge pull request #7997 from tb365/automated-cherry-pick-of-#7994-upstream-release-3.4
Automated cherry pick of #7994: ctyun sync secgroup fix & cloudaccount delete fix
2020-09-22 14:08:19 +08:00
TangBin
0acbfc89f3 ctyun sync secgroup fix & cloudaccount delete fix 2020-09-22 13:58:22 +08:00
zhaoxiangchun
477d36f827 common alert bugfix/3.4 2020-09-22 11:37:14 +08:00
zhaoxiangchun
caa26b7567 bugfix: collect esxi metric timout
1.增加批量获取esxi中metric的接口
2020-09-22 11:13:25 +08:00
yunion-ci-robot
d0bb0afa2d Merge pull request #7933 from swordqiu/automated-cherry-pick-of-#7916-upstream-release-3.4
Automated cherry pick of #7916: fix: keystone initialize data skip nil extra fields
2020-09-21 19:54:14 +08:00
yunion-ci-robot
cb3884b1c5 Merge pull request #7919 from swordqiu/automated-cherry-pick-of-#7918-upstream-release-3.4
Automated cherry pick of #7918: fix: lock/unlock cleanup
2020-09-21 19:48:12 +08:00
yunion-ci-robot
10524ecc9a Merge pull request #7989 from wanyaoqi/automated-cherry-pick-of-#7988-upstream-release-3.4
Automated cherry pick of #7988: fix host deployer base image
2020-09-21 18:33:16 +08:00
wanyaoqi
33fb33a589 fix host deployer base image 2020-09-21 17:55:46 +08:00
yunion-ci-robot
a4b2af90c5 Merge pull request #7981 from yousong/automated-cherry-pick-of-#7980-upstream-release-3.4
Automated cherry pick of #7980: httputils: preserve format val types
2020-09-21 16:40:17 +08:00
Yousong Zhou
3f7155c39c logger: actionlog: add GetI18N 2020-09-21 15:22:06 +08:00
Yousong Zhou
b13d0f6035 logger: actionlog: remove redundant comments 2020-09-21 15:22:06 +08:00
Yousong Zhou
62c0c11c30 db: IModel: add GetI18N() method 2020-09-21 15:22:06 +08:00
Yousong Zhou
6bff7caf9b logclient: i18n: en for const 2020-09-21 15:22:06 +08:00
Yousong Zhou
27d0452faf logclient: i18n: cn for const 2020-09-21 15:22:06 +08:00
Yousong Zhou
b1a332fec1 logclient: convert const val to use latin chars 2020-09-21 15:22:06 +08:00
Yousong Zhou
bc066edc09 logclient: move ws list to separate file 2020-09-21 15:22:06 +08:00
Yousong Zhou
0b878134b6 logclient: separate lines 2020-09-21 15:22:06 +08:00
Yousong Zhou
986031fc97 opslog: move const to separate file 2020-09-21 15:22:06 +08:00
Yousong Zhou
8164854fd0 i18n: add ITable 2020-09-21 15:22:06 +08:00
Yousong Zhou
8dc1796768 i18n: move out from httperrors pkg 2020-09-21 15:22:06 +08:00
Yousong Zhou
a54d0e5920 locales: update translation 2020-09-21 15:22:06 +08:00
Yousong Zhou
822fae0095 treewide: avoid variable fmt str 2020-09-21 15:22:06 +08:00
Yousong Zhou
23b9991a7b treewide: fmt error 2020-09-21 15:22:06 +08:00
Yousong Zhou
4fb45676a4 httputils: preserve format val types 2020-09-21 15:22:06 +08:00
yunion-ci-robot
93e5f8ec97 Merge pull request #7977 from swordqiu/automated-cherry-pick-of-#7975-upstream-release-3.4
Automated cherry pick of #7975: fix: get jnlp xml from dell idrac6,7,9
2020-09-21 10:16:12 +08:00
yunion-ci-robot
29dde04145 Merge pull request #7979 from swordqiu/automated-cherry-pick-of-#7978-upstream-release-3.4
Automated cherry pick of #7978: fix: reset user password without check
2020-09-21 10:12:17 +08:00
yunion-ci-robot
b69d04ee20 Merge pull request #7985 from swordqiu/automated-cherry-pick-of-#7984-upstream-release-3.4
Automated cherry pick of #7984: fix: scheduler token not support policy
2020-09-21 10:09:12 +08:00
yunion-ci-robot
d0af7f9b23 Merge pull request #7983 from yousong/automated-cherry-pick-of-#7982-upstream-release-3.4
Automated cherry pick of #7982: locales: update translations
2020-09-20 00:22:14 +08:00
Qiu Jian
e444ab7a15 fix: scheduler token not support policy 2020-09-19 23:47:29 +08:00
Yousong Zhou
c4f4e7d30b locales: update translations 2020-09-19 23:45:19 +08:00
Qiu Jian
5f35bba0d0 fix: reset user password without check 2020-09-19 00:51:02 +08:00
Qiu Jian
760ac9900f fix: get jnlp xml from dell idrac6,7,9 2020-09-19 00:11:02 +08:00
Zexi Li
be00107c12 Merge pull request #7969 from tb365/automated-cherry-pick-of-#7966-upstream-release-3.4
Automated cherry pick of #7966: ctyun add region cn-bj1
2020-09-18 21:05:31 +08:00
yunion-ci-robot
17cd333b64 Merge pull request #7971 from swordqiu/automated-cherry-pick-of-#7970-upstream-release-3.4
Automated cherry pick of #7970: fix: add esxicli vmrc/webmks command
2020-09-18 21:04:11 +08:00
Zexi Li
346c8ec564 Merge pull request #7974 from rainzm/automated-cherry-pick-of-#7973-upstream-release-3.4
Automated cherry pick of #7973: fix(notify): allow normal user create their receiver
2020-09-18 21:04:08 +08:00
rainzm
aecf977801 fix(notify): allow normal user create their receiver 2020-09-18 17:17:38 +08:00
yunion-ci-robot
7a044d1ac1 Merge pull request #7947 from wanyaoqi/automated-cherry-pick-of-#7927-upstream-release-3.4
Automated cherry pick of #7927: host sync storage size
2020-09-18 16:53:48 +08:00
Qiu Jian
5f9088d240 fix: add esxicli vmrc/webmks command 2020-09-18 14:41:38 +08:00
TangBin
12bd187ec9 ctyun add region cn-bj1 2020-09-18 14:26:17 +08:00
Zexi Li
c1a0b8a8b5 Merge pull request #7962 from zexi/automated-cherry-pick-of-#7961-upstream-release-3.4
Automated cherry pick of #7961: region: fix network schedtag not cleanup when network deleted
2020-09-18 12:44:58 +08:00
Zexi Li
1d7ffc704e region: fix network schedtag not cleanup when network deleted 2020-09-18 10:38:33 +08:00
Zexi Li
ebdefa1f23 Merge pull request #7960 from zexi/automated-cherry-pick-of-#7959-upstream-release-3.4
Automated cherry pick of #7959: climc: add k8s federated resource cmd
2020-09-17 15:43:37 +08:00
Zexi Li
02dc68f20d climc: add k8s federated resource cmd 2020-09-17 15:29:55 +08:00
Zexi Li
9047c8de39 Merge pull request #7956 from zexi/automated-cherry-pick-of-#7954-upstream-release-3.4
Automated cherry pick of #7954: cloudcommon: get joint model should aware fieldname
2020-09-17 10:33:57 +08:00
yunion-ci-robot
ae3073da48 Merge pull request #7942 from zhaoxiangchun/automated-cherry-pick-of-#7941-upstream-release-3.4
Automated cherry pick of #7941: suggest rule modify:
2020-09-16 21:42:20 +08:00
Zexi Li
ab2567d17d Merge pull request #7955 from wanyaoqi/automated-cherry-pick-of-#7953-upstream-release-3.4
Automated cherry pick of #7953: fix set host image cache properties
2020-09-16 21:38:16 +08:00
Zexi Li
ba03954e50 Merge pull request #7949 from wanyaoqi/automated-cherry-pick-of-#7948-upstream-release-3.4
Automated cherry pick of #7948: fix update image status after save failed
2020-09-16 21:36:15 +08:00
Zexi Li
6c6b7bb6fa Merge pull request #7913 from ioito/automated-cherry-pick-of-#7912-upstream-release-3.4
Automated cherry pick of #7912: fix: 支持自动根据云上项目修改本地项目名称
2020-09-16 21:35:01 +08:00
yunion-ci-robot
b3f62ee186 Merge pull request #7944 from lvyangyang/automated-cherry-pick-of-#7943-upstream-release-3.4
Automated cherry pick of #7943: dup record process
2020-09-16 21:04:51 +08:00
yunion-ci-robot
bc66fd558a Merge pull request #7946 from wanyaoqi/automated-cherry-pick-of-#7945-upstream-release-3.4
Automated cherry pick of #7945: scheduler: fix fillter isolated device
2020-09-16 20:58:12 +08:00
Zexi Li
4164bf58c1 cloudcommon: get joint model should aware fieldname 2020-09-16 20:52:19 +08:00
wanyaoqi
5593b88e98 fix set host image cache properties 2020-09-16 20:51:52 +08:00
wanyaoqi
785da09d62 fix update image status after save failed 2020-09-16 19:14:07 +08:00
wanyaoqi
585ef58332 host sync storage size 2020-09-16 19:02:27 +08:00
wanyaoqi
8e0f47aa0c scheduler: fix fillter isolated device 2020-09-16 18:32:05 +08:00
lvyangyang
4487867f53 dup record process 2020-09-16 18:31:12 +08:00
zhaoxiangchun
9b12c675d2 suggest rule modify:
1.规则由后端初始化,默认禁用
2.规则period默认为12h,扫描范围timeFrom默认为14d
3.增加notify相关的模版文件
4.更改消息重复发送的问题
2020-09-16 12:56:58 +08:00
Zexi Li
a2d7bd16a2 Merge pull request #7940 from zhaoxiangchun/automated-cherry-pick-of-#7938-upstream-release-3.4
Automated cherry pick of #7938: bugfix vmware monitor
2020-09-16 11:35:06 +08:00
Zexi Li
10625a4b26 Merge pull request #7936 from swordqiu/automated-cherry-pick-of-#7935-upstream-release-3.4
Automated cherry pick of #7935: fix: disable qcloud verifyAppId temporarily
2020-09-16 11:33:53 +08:00
Zexi Li
e64ac81f87 Merge pull request #7911 from rainzm/automated-cherry-pick-of-#7910-upstream-release-3.4
Automated cherry pick of #7910: Feat & Fix of Notify
2020-09-16 11:32:46 +08:00
Zexi Li
e42afce6f3 Merge pull request #7926 from ioito/automated-cherry-pick-of-#7925-upstream-release-3.4
Automated cherry pick of #7925: fix: 避免名称重复
2020-09-16 11:31:52 +08:00
Zexi Li
ad0b9e3bd3 Merge pull request #7932 from swordqiu/automated-cherry-pick-of-#7931-upstream-release-3.4
Automated cherry pick of #7931: fix: omit empty fail reason
2020-09-16 11:31:20 +08:00
yunion-ci-robot
d4e2158caf Merge pull request #7930 from swordqiu/automated-cherry-pick-of-#7929-upstream-release-3.4
Automated cherry pick of #7929: fix: enable generate name caused compability issue
2020-09-16 11:30:09 +08:00
Zexi Li
a09932d8ac Merge pull request #7922 from ioito/automated-cherry-pick-of-#7921-upstream-release-3.4
Automated cherry pick of #7921: fix: bucket object cnt fix
2020-09-16 11:30:04 +08:00
zhaoxiangchun
2a680f99a7 bugfix vmware monitor 2020-09-16 10:28:59 +08:00
Qiu Jian
7601ca437a fix: disable qcloud verifyAppId temporarily 2020-09-16 02:21:22 +08:00
Qiu Jian
967d46bbf6 fix: keystone initialize data skip nil extra fields 2020-09-16 01:59:27 +08:00
Qiu Jian
a475a7b416 fix: omit empty fail reason 2020-09-16 01:56:02 +08:00
Qiu Jian
0d798412e1 fix: enable generate name caused compability issue 2020-09-16 01:36:33 +08:00
Qu Xuan
a1ba06a927 fix: 避免名称重复 2020-09-15 19:30:24 +08:00
Qu Xuan
cc5e0cd7ca fix: bucket object cnt fix 2020-09-15 19:13:38 +08:00
Qiu Jian
ada7352469 fix: lock/unlock cleanup 2020-09-15 12:26:47 +08:00
yunion-ci-robot
ef9dac1a86 Merge pull request #7917 from zexi/automated-cherry-pick-of-#7915-upstream-release-3.4
Automated cherry pick of #7915: cloudcommon: joint model list should add field_name into query
2020-09-15 10:27:12 +08:00
yunion-ci-robot
f71d26d2b2 Merge pull request #7906 from wanyaoqi/automated-cherry-pick-of-#7905-upstream-release-3.4
Automated cherry pick of #7905: webconsole: fix defer order to release zombie process
2020-09-15 10:26:10 +08:00
Zexi Li
82e38b8f51 cloudcommon: joint model list should add field_name into query 2020-09-14 23:38:11 +08:00
Qu Xuan
5c71349fe2 fix: 支持自动根据云上项目修改本地项目名称 2020-09-14 21:13:27 +08:00
rainzm
f24950da96 feat(notify): sort the returned contact type array 2020-09-14 20:35:12 +08:00
rainzm
0308ce2882 feat: notify user when failing to change config 2020-09-14 20:35:12 +08:00
rainzm
cee07e7861 feat: add NotifyError in notifyclient
NotifyError send error message to user from userCred.
2020-09-14 20:35:12 +08:00
rainzm
8eba2c369f feat: add WithCtx version to notifyclient function 2020-09-14 20:35:12 +08:00
rainzm
5a10f9dd9c feat(region): divide notify templates into Chinese and English versions
Chinese version: content@cn, title@cn
English version: content@en, title@en
2020-09-14 20:35:12 +08:00
rainzm
c542249c7c feat(region): replace 虚拟机 with 主机 or 云主机 2020-09-14 20:35:12 +08:00
wanyaoqi
fa2d8723a6 webconsole: fix defer order to release zombie process 2020-09-14 18:20:47 +08:00
Zexi Li
523b0d132f Merge pull request #7903 from rainzm/automated-cherry-pick-of-#7902-upstream-release-3.4
Automated cherry pick of #7902: fix(esxi): return when host.Vm is empty
2020-09-14 16:28:08 +08:00
rainzm
6bfca36cb7 fix(esxi): return when host.Vm is empty 2020-09-14 16:26:34 +08:00
yunion-ci-robot
e41c29e6d0 Merge pull request #7900 from ioito/automated-cherry-pick-of-#7899-upstream-release-3.4
Automated cherry pick of #7899: fix: cos use proxy
2020-09-14 14:03:14 +08:00
Zexi Li
6010b253f2 Merge pull request #7896 from wanyaoqi/automated-cherry-pick-of-#7895-upstream-release-3.4
Automated cherry pick of #7895: disk: check disk is need renew on guest set renew
2020-09-14 13:02:07 +08:00
Qu Xuan
0a5ee4ca67 fix: cos use proxy 2020-09-14 13:01:07 +08:00
wanyaoqi
77f479ce60 disk: check disk is need renew on guest set renew 2020-09-14 12:07:48 +08:00
yunion-ci-robot
f8b7d96c62 Merge pull request #7894 from swordqiu/automated-cherry-pick-of-#7893-upstream-release-3.4
Automated cherry pick of #7893: fix: check host sharing status when considering whether a host is assignable
2020-09-12 23:58:08 +08:00
yunion-ci-robot
fda5c3aaa5 Merge pull request #7891 from swordqiu/automated-cherry-pick-of-#7890-upstream-release-3.4
Automated cherry pick of #7890: fix: disable webkms for esxi older than 6.5
2020-09-12 23:55:21 +08:00
yunion-ci-robot
0e88ac81c3 Merge pull request #7888 from yousong/automated-cherry-pick-of-#7887-upstream-release-3.4
Automated cherry pick of #7887: elasticips: filter by owner when doing auto allocation
2020-09-12 23:54:09 +08:00
Qiu Jian
6b5339900b fix: check host sharing status when considering whether a host is assignable 2020-09-12 20:52:09 +08:00
yunion-ci-robot
60b1eddfd8 Merge pull request #7886 from zexi/automated-cherry-pick-of-#7885-upstream-release-3.4
Automated cherry pick of #7885: scheduler: ignore network type when specified
2020-09-12 17:34:08 +08:00
Qiu Jian
7cf5ad9133 fix: disable webkms for esxi older than 6.5 2020-09-12 17:29:50 +08:00
Yousong Zhou
8a0f940b38 elasticips: filter by owner when doing auto allocation 2020-09-12 17:14:41 +08:00
Zexi Li
a1c7a291d5 scheduler: ignore network type when specified 2020-09-12 15:59:17 +08:00
Zexi Li
891b7223f1 Merge pull request #7884 from rainzm/automated-cherry-pick-of-#7883-upstream-release-3.4
Automated cherry pick of #7883: feat(region): change fomat 'id' to 'name(id)' in scheduledtasks' log
2020-09-11 21:06:38 +08:00
yunion-ci-robot
9ef5a43513 Merge pull request #7877 from ioito/automated-cherry-pick-of-#7876-upstream-release-3.4
Automated cherry pick of #7876: fix: 默认不自动合并安全组
2020-09-11 21:05:58 +08:00
Zexi Li
490a0a7fe5 Merge pull request #7880 from ioito/automated-cherry-pick-of-#7879-upstream-release-3.4
Automated cherry pick of #7879: fix: avoid sync natgateway eip panic
2020-09-11 21:03:40 +08:00
Zexi Li
06c27791bb Merge pull request #7871 from rainzm/automated-cherry-pick-of-#7870-upstream-release-3.4
Automated cherry pick of #7870: fix(esxiagent): add HostDelayTaskWorkerCount
2020-09-11 20:55:33 +08:00
Zexi Li
690c3b23a4 Merge pull request #7863 from wanyaoqi/automated-cherry-pick-of-#7836-upstream-release-3.4
Automated cherry pick of #7836: host: fix rbd storage cache iso image
2020-09-11 20:54:17 +08:00
Zexi Li
6bc6309253 Merge pull request #7868 from ioito/automated-cherry-pick-of-#7862-upstream-release-3.4
Automated cherry pick of #7862: fix: add dns recordset dns value check
2020-09-11 20:53:28 +08:00
rainzm
7b67554dcc feat(region): change fomat 'id' to 'name(id)' in scheduledtasks' log 2020-09-11 20:37:54 +08:00
Qu Xuan
ce777855a2 fix: 默认不自动合并安全组 2020-09-11 19:23:15 +08:00
Qu Xuan
9607420298 fix: avoid sync natgateway eip panic 2020-09-11 19:17:25 +08:00
rainzm
4e7e8a59dc fix(esxiagent): add HostDelayTaskWorkerCount
之前,HostDelayWorker 是通过 hostutils.InitWorkerManager 来初始化,
worker的数量依赖于options.HostOptions.DefaultRequestWorkerCount, 因为
这个options没有经过初始化,所以就是0,导致worker count的数量变为1。

现在增加了 HostDelayTaskWorkerCount 来管理这个count,默认值为8。
2020-09-11 17:19:46 +08:00
Qu Xuan
2e93ee3d6d fix: add dns recordset dns value check 2020-09-11 14:26:01 +08:00
wanyaoqi
6a7cf0608d host: fix rbd storage cache iso image 2020-09-10 23:13:58 +08:00
yunion-ci-robot
5f7734b0c3 Merge pull request #7860 from ioito/automated-cherry-pick-of-#7859-upstream-release-3.4
Automated cherry pick of #7859: fix: 平滑迁移数据
2020-09-10 21:42:53 +08:00
yunion-ci-robot
413ba9ddd4 Merge pull request #7858 from lvyangyang/automated-cherry-pick-of-#7762-upstream-release-3.4
Automated cherry pick of #7762: dns access
2020-09-10 21:37:56 +08:00
yunion-ci-robot
0048507211 Merge pull request #7856 from ioito/automated-cherry-pick-of-#7855-upstream-release-3.4
Automated cherry pick of #7855: fix: optimized qcloud keypair
2020-09-10 21:34:33 +08:00
Qu Xuan
d6d490af6c fix: 平滑迁移数据 2020-09-10 17:39:40 +08:00
lvyangyang
70297e3130 dns access 2020-09-10 17:33:17 +08:00
Qu Xuan
5576819f01 fix: 腾讯云不支持同时设置秘钥和密码,若设置秘钥,则将密码置空 2020-09-10 17:25:32 +08:00
Qu Xuan
dc20313ef5 fix: optimized qcloud keypair 2020-09-10 17:25:32 +08:00
yunion-ci-robot
fb7b5d5a95 Merge pull request #7854 from rainzm/automated-cherry-pick-of-#7832-upstream-release-3.4
Automated cherry pick of #7832: refactor(region): optimize preparenet of cloudaccount
2020-09-10 16:04:55 +08:00
rainzm
3f77c01e6b refactor(region): optimize preparenet of cloudaccount
1. 从vcenter中获取host和vm的信息时,只需要获取网络相关的字段就可以了。
2. 每个host的vms,单独启用一个goroutine。
3. 优化了处理vms ip的逻辑,现在的时间复杂度是O(n)。
2020-09-10 15:41:13 +08:00
yunion-ci-robot
5ec2490be5 Merge pull request #7853 from rainzm/automated-cherry-pick-of-#7852-upstream-release-3.4
Automated cherry pick of #7852: fix(notify): pull contact for workwx, dingtalk and feishu
2020-09-10 15:18:01 +08:00
rainzm
dba92d4b0b fix(notify): pull contact for workwx, dingtalk and feishu 2020-09-10 14:41:27 +08:00
yunion-ci-robot
6f77c22573 Merge pull request #7835 from ioito/automated-cherry-pick-of-#7834-upstream-release-3.4
Automated cherry pick of #7834: fix: uniform cachedimage active status
2020-09-10 14:36:02 +08:00
yunion-ci-robot
f653b36733 Merge pull request #7851 from ioito/automated-cherry-pick-of-#7837-upstream-release-3.4
Automated cherry pick of #7837: fix: optimzed clouduser password
2020-09-10 14:33:55 +08:00
Qu Xuan
aa26c6ec99 fix: optimzed clouduser password 2020-09-10 10:24:21 +08:00
yunion-ci-robot
0e0df0999b Merge pull request #7844 from ioito/automated-cherry-pick-of-#7843-upstream-release-3.4
Automated cherry pick of #7843: fix: optimzed clouduser
2020-09-10 09:49:23 +08:00
yunion-ci-robot
5f0b86950b Merge pull request #7842 from ioito/automated-cherry-pick-of-#7841-upstream-release-3.4
Automated cherry pick of #7841: fix: avoid create public zone failed
2020-09-10 09:47:56 +08:00
yunion-ci-robot
d1660c83a9 Merge pull request #7839 from swordqiu/automated-cherry-pick-of-#7831-upstream-release-3.4
Automated cherry pick of #7831: fix: recode project-role rpc handle to support group role assignment results by user or project
2020-09-10 09:46:54 +08:00
yunion-ci-robot
f302756eda Merge pull request #7840 from zhaoxiangchun/automated-cherry-pick-of-#7838-upstream-release-3.4
Automated cherry pick of #7838: commonalert bugfix:
2020-09-10 09:44:53 +08:00
yunion-ci-robot
90185c0074 Merge pull request #7846 from rainzm/automated-cherry-pick-of-#7845-upstream-release-3.4
Automated cherry pick of #7845: Feat & Fix & Refactor for ESXi
2020-09-10 09:41:58 +08:00
rainzm
55b2b29001 fix(region): add RequestSyncstatusOnHost for SESXiGuestDriver
esxi 平台 Guest 进行 syncstatus 和其他平台有所区别,Vcenter 可能会更改
 VM 所在的 Host,所以在 Host 上寻找 VM 可能会出现 ErrNotFound。此时,应该
主动去整个 datacenter 中寻找 VM,然后更改 Host,进行同步。
2020-09-09 21:53:51 +08:00
rainzm
ac69f8a590 fix(esxi): fetch templatevm from datacenter before clone vm
这里应该和image_cache那里保持一直,对template的获取应该从datacenter
中获取,而不是host。
2020-09-09 21:53:51 +08:00
rainzm
42faf34f15 refactor(esxi): replace GetTemplateVMById with FetchTemplateVMById
FetchTemplateVMById 更好,因为它更轻量,更快。
2020-09-09 21:53:51 +08:00
rainzm
3f8f9e6c56 feat(esxicli): better vm operator
现在,可以通过Datacenter来获取vm,不一定要指定HostIp,
Datacenter和HostIp必须指定一个。
2020-09-09 21:53:51 +08:00
rainzm
6b340264e4 feat(esxi): support fetchVM form datacenter 2020-09-09 21:53:51 +08:00
rainzm
ef8768fcef refactor(esxi): fetchVms and fetchHardwareInfo
1. fetchHardwareInfo 只有一种error,原因是moVM的某些字段为nil,这种情况下,完全可以打印日志直接返回。
2. fetchVms 现在只返回[]*SVirtualMachine, 进一步的过滤(是不是template)交给调用者。
2020-09-09 21:53:51 +08:00
Qu Xuan
9281c54294 fix: optimzed clouduser 2020-09-09 20:12:40 +08:00
Qu Xuan
2ad1a4afe5 fix: avoid create public zone failed 2020-09-09 19:54:45 +08:00
zhaoxiangchun
1a323667ad commonalet bugfix:
1.报警接受人通知渠道调整:由notify中解释发送到对应的channel
2.报警恢复增加对应的evalmatch,保存对应的metricvalue
3.报警记录中增加description相关信息
4.其他代码调整
2020-09-09 18:32:56 +08:00
Qiu Jian
0268d95853 fix: recode project-role rpc handle to support group role assignment results by user or project 2020-09-09 18:19:36 +08:00
Qu Xuan
025eca548f fix: uniform cachedimage active status 2020-09-09 15:21:43 +08:00
yunion-ci-robot
4cea5a1c9f Merge pull request #7829 from swordqiu/automated-cherry-pick-of-#7828-upstream-release-3.4
Automated cherry pick of #7828: fix: wire usage stats incorrect
2020-09-08 20:28:56 +08:00
yunion-ci-robot
cb1c8d7961 Merge pull request #7827 from swordqiu/automated-cherry-pick-of-#7820-upstream-release-3.4
Automated cherry pick of #7820: fix: ignore 409 error when doing redfish power on
2020-09-08 20:26:52 +08:00
yunion-ci-robot
408f975f40 Merge pull request #7822 from rainzm/automated-cherry-pick-of-#7821-upstream-release-3.4
Automated cherry pick of #7821: fix(esxiagent): return image extid not id
2020-09-08 20:23:55 +08:00
Qiu Jian
621c2796d6 fix: wire usage stats incorrect 2020-09-08 16:41:48 +08:00
Qiu Jian
d10adf22d7 fix: ignore 409 error when doing redfish power on 2020-09-08 15:34:59 +08:00
rainzm
3ef91f92e5 fix(esxiagent): return image extid not id
调用 disk/image_cache 接口的Task StorageCacheImageTask 会根据回调
回来数据中的 image_id,来设置 storagecachedimage 中的 externalid,
所以这里的 image_id 应该是 externalid。
2020-09-08 15:33:18 +08:00
yunion-ci-robot
e75e5a9b95 Merge pull request #7803 from rainzm/automated-cherry-pick-of-#7802-upstream-release-3.4
Automated cherry pick of #7802: Optimization of the scheduler
2020-09-08 14:59:53 +08:00
rainzm
348ca46a08 fix(scheduler): more standardized testing 2020-09-08 14:28:09 +08:00
rainzm
6000874b3c refactor(scheduler): make forcast result clearer
forcast 的返回值包括:
1. CanCreate: 是否可以创建
2. FilteredCandidate: 被过滤掉的candidate(宿主机),并记录了
   过滤其的 filter 的名字以及给出的原因。
3. ReqCount: 请求的机器数量
4. AllowCount: 允许的机器数量
5. NotAllowReasons: 不允许的原因,每一个不被允许的都会被列出原因。
2020-09-08 14:28:09 +08:00
rainzm
89980b6267 Add mock test for genericScheudler.Schedule 2020-09-08 14:28:09 +08:00
rainzm
d086161a68 feat: Add method 'Sku' to CandidatePropertyGetter 2020-09-08 14:28:09 +08:00
rainzm
39fed764fe feat: Add IResultHelper
1. Adjust the package structure about pkg/scheduler/core and
pkg/scheduler/manager

2. Add IResultHelper

3. Change the signature of genericScheduler.Schedule
func (*Unit, []Candidater) (*SchedResultItemList, error) ==>
func (*Unit, []Candidater, IResultHelper) (*ScheduleResult, error)
2020-09-08 14:28:09 +08:00
yunion-ci-robot
426699ada9 Merge pull request #7819 from wanyaoqi/automated-cherry-pick-of-#7810-upstream-release-3.4
Automated cherry pick of #7810: fix host error output
2020-09-08 10:03:18 +08:00
yunion-ci-robot
82d297eb77 Merge pull request #7809 from swordqiu/automated-cherry-pick-of-#7808-upstream-release-3.4
Automated cherry pick of #7808: fix: check assign-host previliges
2020-09-08 10:01:56 +08:00
yunion-ci-robot
92ecdb5f8d Merge pull request #7818 from wanyaoqi/automated-cherry-pick-of-#7817-upstream-release-3.4
Automated cherry pick of #7817: isolated devices info reenterable
2020-09-08 09:59:54 +08:00
wanyaoqi
ada6c870d8 fix host error output 2020-09-07 21:08:13 +08:00
yunion-ci-robot
86dd4804a3 Merge pull request #7816 from rainzm/automated-cherry-pick-of-#7807-upstream-release-3.4
Automated cherry pick of #7807: fix(notify): break down permissions of notifyconfigs
2020-09-07 21:06:03 +08:00
yunion-ci-robot
cecaa127ea Merge pull request #7805 from yousong/automated-cherry-pick-of-#7804-upstream-release-3.4
Automated cherry pick of #7804: vpcagent: guard against foul eip records
2020-09-07 21:05:46 +08:00
yunion-ci-robot
4d68b5fb61 Merge pull request #7797 from ioito/automated-cherry-pick-of-#7796-upstream-release-3.4
Automated cherry pick of #7796: fix: sync groups for user
2020-09-07 21:03:50 +08:00
yunion-ci-robot
8a329b2b29 Merge pull request #7790 from wanyaoqi/automated-cherry-pick-of-#7789-upstream-release-3.4
Automated cherry pick of #7789: fix get ubuntu version
2020-09-07 21:01:53 +08:00
yunion-ci-robot
c50659a1e4 Merge pull request #7815 from yousong/automated-cherry-pick-of-#7814-upstream-release-3.4
Automated cherry pick of #7814: httperrors: add Error type
2020-09-07 20:59:46 +08:00
yunion-ci-robot
a30df54cb9 Merge pull request #7799 from wanyaoqi/automated-cherry-pick-of-#7798-upstream-release-3.4
Automated cherry pick of #7798: guest short desc add backup host id
2020-09-07 20:57:45 +08:00
yunion-ci-robot
b192e949de Merge pull request #7813 from swordqiu/automated-cherry-pick-of-#7811-upstream-release-3.4
Automated cherry pick of #7811: fix: prevent users in disabled idp from login
2020-09-07 20:55:43 +08:00
yunion-ci-robot
a33a21f712 Merge pull request #7794 from ioito/automated-cherry-pick-of-#7793-upstream-release-3.4
Automated cherry pick of #7793: fix: aliyun wulanchabu region
2020-09-07 20:55:14 +08:00
wanyaoqi
78f9db1ba0 isolated devices info reenterable 2020-09-07 20:46:26 +08:00
rainzm
72276d038d fix(notify): break down permissions of notifyconfigs
1. Only allow admin to create, list, update or delete.
2. Allow user to get types.
2020-09-07 18:56:59 +08:00
Yousong Zhou
f1995a46d8 treewide: DeleteFailReason as an object with translated details 2020-09-07 18:53:07 +08:00
Yousong Zhou
918dce80e8 httperrors: HTTPError: use Error type 2020-09-07 18:53:07 +08:00
Yousong Zhou
12899ab007 httperrors: add Error type 2020-09-07 18:53:07 +08:00
Qiu Jian
e758c4aa97 fix: prevent users in disabled idp from login 2020-09-07 18:25:39 +08:00
Qiu Jian
623c71b143 fix: check assign-host previliges 2020-09-07 18:15:03 +08:00
Yousong Zhou
f0faf07b61 vpcagent: guard against foul eip records 2020-09-07 17:27:12 +08:00
wanyaoqi
8c4941ea70 guest short desc add backup host id 2020-09-07 17:05:34 +08:00
Qu Xuan
4cd73c16ca fix: sync groups for user 2020-09-07 16:35:47 +08:00
Qu Xuan
0a79d1d23e fix: aliyun wulanchabu region 2020-09-07 16:10:37 +08:00
wanyaoqi
d22676906c fix get ubuntu version 2020-09-07 15:40:33 +08:00
yunion-ci-robot
74b3bf2c6a Merge pull request #7787 from rainzm/automated-cherry-pick-of-#7786-upstream-release-3.4
Automated cherry pick of #7786: fix(scheduler): fix array out of bounds when sorting hosts
2020-09-07 15:31:43 +08:00
yunion-ci-robot
c94a90398e Merge pull request #7783 from rainzm/automated-cherry-pick-of-#7782-upstream-release-3.4
Automated cherry pick of #7782: fix(notify): Replace String() with GetString()
2020-09-07 15:28:41 +08:00
yunion-ci-robot
b57bbc66c7 Merge pull request #7781 from swordqiu/automated-cherry-pick-of-#7780-upstream-release-3.4
Automated cherry pick of #7780: fix: user idps attributes includes template name
2020-09-07 15:24:41 +08:00
rainzm
4f9c37239e fix(scheduler): fix array out of bounds when sorting hosts 2020-09-07 15:18:51 +08:00
rainzm
8524fda7f8 fix(notify): Replace String() with GetString()
The String() of jsonutils.JSONObject will add a pair of
double quotes around the content. The GetString() will
get a clean content.
2020-09-07 15:10:54 +08:00
Qiu Jian
bfa4ce38e0 fix: user idps attributes includes template name 2020-09-07 13:01:23 +08:00
yunion-ci-robot
70d790187e Merge pull request #7778 from ioito/automated-cherry-pick-of-#7729-upstream-release-3.4
Automated cherry pick of #7729: optimized cachedimages sync
2020-09-07 11:08:42 +08:00
Qu Xuan
7095ea8f8b optimized cachedimages sync 2020-09-07 10:16:33 +08:00
yunion-ci-robot
4edff8ae34 Merge pull request #7770 from swordqiu/automated-cherry-pick-of-#7769-upstream-release-3.4
Automated cherry pick of #7769: fix: network address list respect privilige of user
2020-09-05 15:50:42 +08:00
yunion-ci-robot
fd750e0a9c Merge pull request #7773 from swordqiu/automated-cherry-pick-of-#7772-upstream-release-3.4
Automated cherry pick of #7772: fix: skup syncing lb, rds, redis instances in tasks
2020-09-05 15:48:43 +08:00
Zexi Li
f0ae739747 Merge pull request #7777 from zexi/automated-cherry-pick-of-#7776-upstream-release-3.4
Automated cherry pick of #7776: climc: k8s cluster grafana componet support subpath
2020-09-05 15:37:48 +08:00
Zexi Li
7f5124bdf2 climc: k8s cluster grafana componet support subpath 2020-09-05 14:47:04 +08:00
Qiu Jian
c5c2b4b699 fix: skup syncing lb, rds, redis instances in tasks 2020-09-05 14:30:07 +08:00
Qiu Jian
29edf83293 fix: network address list respect privilige of user 2020-09-05 12:01:01 +08:00
yunion-ci-robot
1c3bbb70a3 Merge pull request #7768 from ioito/automated-cherry-pick-of-#7767-upstream-release-3.4
Automated cherry pick of #7767: fix: cloudid optimized
2020-09-05 10:32:46 +08:00
Qu Xuan
390d6f07e1 fix: cloudid optimized 2020-09-04 20:23:18 +08:00
yunion-ci-robot
41e2757973 Merge pull request #7766 from tb365/automated-cherry-pick-of-#7764-upstream-release-3.4
Automated cherry pick of #7764: pex register add optional column mac_access
2020-09-04 20:15:41 +08:00
yunion-ci-robot
a7160e7518 Merge pull request #7763 from ioito/automated-cherry-pick-of-#7739-upstream-release-3.4
Automated cherry pick of #7739: fix: valid update name and update dns recordset
2020-09-04 20:14:14 +08:00
yunion-ci-robot
01f07c6044 Merge pull request #7761 from swordqiu/automated-cherry-pick-of-#7760-upstream-release-3.4
Automated cherry pick of #7760: fix: scheduler aware policy
2020-09-04 16:20:40 +08:00
TangBin
24af17757d pex register add optional column mac_access 2020-09-04 15:57:38 +08:00
Qu Xuan
b4252c7c25 fix: valid update name and update dns recordset 2020-09-04 14:10:14 +08:00
Qiu Jian
4853883947 fix: scheduler aware policy 2020-09-04 11:10:36 +08:00
Zexi Li
82795f2daf Merge pull request #7752 from ioito/automated-cherry-pick-of-#7751-upstream-release-3.4
Automated cherry pick of #7751: fix: optimized cloudid
2020-09-04 10:33:20 +08:00
Zexi Li
cf056fe42a Merge pull request #7750 from rainzm/automated-cherry-pick-of-#7748-upstream-release-3.4
Automated cherry pick of #7748: feat(esxi): correctly judge whether inet is nil
2020-09-04 10:32:32 +08:00
Zexi Li
1aa16871eb Merge pull request #7755 from swordqiu/automated-cherry-pick-of-#7740-upstream-release-3.4
Automated cherry pick of #7740: fix: find correct esxi host access ip
2020-09-04 10:31:54 +08:00
Zexi Li
4dfd459b14 Merge pull request #7758 from swordqiu/automated-cherry-pick-of-#7757-upstream-release-3.4
Automated cherry pick of #7757: fix: support VirtualDiskRawDiskMappingVer1BackingInfo
2020-09-04 10:31:17 +08:00
Zexi Li
3d1bce5f51 Merge pull request #7754 from swordqiu/automated-cherry-pick-of-#7753-upstream-release-3.4
Automated cherry pick of #7753: fix: remove redundant auth cookie in sso login
2020-09-04 10:30:47 +08:00
Zexi Li
5ff14eb618 Merge pull request #7745 from wanyaoqi/automated-cherry-pick-of-#7744-upstream-release-3.4
Automated cherry pick of #7744: glance: check min disk size on update
2020-09-04 10:29:49 +08:00
Zexi Li
57c0706d9e Merge pull request #7742 from swordqiu/automated-cherry-pick-of-#7741-upstream-release-3.4
Automated cherry pick of #7741: fix: search by chs projectname or domainname
2020-09-04 10:29:00 +08:00
Zexi Li
4dfa6f8b19 Merge pull request #7736 from rainzm/automated-cherry-pick-of-#7735-upstream-release-3.4
Automated cherry pick of #7735: fix(compute): return InputParameterError while ValidateCreateData
2020-09-04 10:27:46 +08:00
Qiu Jian
0619da6f14 fix: support VirtualDiskRawDiskMappingVer1BackingInfo 2020-09-04 00:15:14 +08:00
yunion-ci-robot
f62912dd5b Merge pull request #7734 from rainzm/automated-cherry-pick-of-#7733-upstream-release-3.4
Automated cherry pick of #7733: Feature & Fix for Notify
2020-09-04 00:03:42 +08:00
Qiu Jian
29a3db9ff6 fix: find correct esxi host access ip 2020-09-03 23:56:30 +08:00
Qiu Jian
c50497090e fix: remove redundant auth cookie in sso login 2020-09-03 23:54:15 +08:00
yunion-ci-robot
47f5f9edc1 Merge pull request #7731 from swordqiu/automated-cherry-pick-of-#7730-upstream-release-3.4
Automated cherry pick of #7730: fix: compatiblity fixes with lenovo RD620 and huawei 2288 fix: compatiblity fixes with lenovo RD620 and huawei 2288
2020-09-03 21:54:51 +08:00
rainzm
ff52e00448 feat(notify): Allow use topic to filter notification 2020-09-03 21:25:05 +08:00
rainzm
7c6e053a08 feat(notify): Add TNotifyChannel const of robot 2020-09-03 21:25:05 +08:00
rainzm
8c6fdd1106 feat(notify): replace VerifiedContactTypes with VerifiedInfos in ReceiverDetails
VerifiedInfos will provide Note to display.
2020-09-03 21:25:05 +08:00
rainzm
beee6e2c9f feat(notify): Support trigger-verify for feishu, dingtalk and workwx 2020-09-03 21:25:04 +08:00
rainzm
60412cf7e8 feat(notify): Add VerifiedNote for SSubContact
VerifiedNote will be 'ok' if SSubContact verified successfully.
Otherwise, there will be there value for VerifiedNote:
1. no such mobile: mobile is not exist, change and try again.
2. incomplete config: tell admin to improve the configuration.
3. service exceptions: try again or connect to admin.
2020-09-03 21:25:04 +08:00
rainzm
90b84e995b feat(notify): break down error from UseridByMobile 2020-09-03 21:25:04 +08:00
rainzm
851b2d4bb7 fix(notify): Set default priority 'normal' when creating notification 2020-09-03 21:25:04 +08:00
rainzm
ab02e166e9 fix(notify): Mark verified not enabled in MarkContactTypeVerified 2020-09-03 21:25:04 +08:00
rainzm
10caff1d9c refactor(notify): hide SSunContact webconsole
Every receiver has webconsole type contact that is equal with
receiverid.
Now, make webconsole invisible, and it does exist.
2020-09-03 21:25:04 +08:00
rainzm
82b7e659ad fix(notify): Allow user list receivers 2020-09-03 21:25:04 +08:00
rainzm
9e1a7c5e12 fix(notify): use AfterSend for contact with succuessful sending 2020-09-03 21:25:04 +08:00
Qu Xuan
5cc25ae10a fix: optimzed sync 2020-09-03 21:18:30 +08:00
Qu Xuan
cfd76b23a3 fix: optimized cloudid 2020-09-03 21:18:30 +08:00
rainzm
65ca3ace74 feat(esxi): correctly judge whether inet is nil 2020-09-03 20:35:32 +08:00
wanyaoqi
00265fedda glance: check min disk size on update 2020-09-03 20:00:45 +08:00
Qiu Jian
976dbd7796 fix: search by chs projectname or domainname 2020-09-03 18:38:48 +08:00
rainzm
c050629ba2 fix(compute): return InputParameterError while ValidateCreateData 2020-09-03 15:24:03 +08:00
Qiu Jian
949e2ebed9 fix: compatiblity fixes with lenovo RD620 and huawei 2288 2020-09-03 11:50:00 +08:00
yunion-ci-robot
dc19a10323 Merge pull request #7728 from tb365/automated-cherry-pick-of-#7725-upstream-release-3.4
Automated cherry pick of #7725: create classic vpc fix
2020-09-03 10:32:41 +08:00
TangBin
612ad9286b create classic vpc fix 2020-09-02 18:26:16 +08:00
yunion-ci-robot
32bc9b45a1 Merge pull request #7721 from ioito/automated-cherry-pick-of-#7587-upstream-release-3.4
Automated cherry pick of #7587: feature: add dns interface
2020-09-02 18:00:06 +08:00
Qu Xuan
03456eaaa9 fix: avoid nil panic 2020-09-02 17:27:24 +08:00
Qu Xuan
d03fddcd7d fix: avoid policy value not save 2020-09-02 17:27:24 +08:00
Qu Xuan
893085a2c6 fix: climc params 2020-09-02 17:27:24 +08:00
Qu Xuan
a85a1aecd4 feature: add dns interface 2020-09-02 17:27:24 +08:00
yunion-ci-robot
c3d7168622 Merge pull request #7717 from zhaoxiangchun/automated-cherry-pick-of-#7716-upstream-release-3.4
Automated cherry pick of #7716: alert record bugfix
2020-09-02 16:33:42 +08:00
yunion-ci-robot
06c0ada74c Merge pull request #7719 from wanyaoqi/automated-cherry-pick-of-#7718-upstream-release-3.4
Automated cherry pick of #7718: vmware disk support deploy lvm partition
2020-09-02 16:31:45 +08:00
yunion-ci-robot
6e5f5b2ea3 Merge pull request #7723 from wanyaoqi/automated-cherry-pick-of-#7722-upstream-release-3.4
Automated cherry pick of #7722: update host status to unknown on host offline
2020-09-02 16:28:40 +08:00
Rain Zheng
eb9d794fab Automated cherry pick of #7714: Feature & Fix for Notify (#7715)
* feat(notify): Add 'get-types' action for ConfigManager

The List interface is only open to administrators,
because we don't want anyone other than administrators
to see the details of the notify configuration.
To let general user to kown available notification channels,
add 'get-types' actions of ConfigManager.

* feat(notify): Check the availability of contact type before creating notification

Creating notification with unconfigured contact type will fail at
sending message. Now, prevent creation in advance.

* feat(notify): Add workwx for NotifyNormal/Important/Critical

* feat(notify): Add Notify about robot in notifyclient

* fix(notify): Init ParentContactType for SSubContact

1. ParentContactType of SSubContact with webconsole type is empty.
2. ParentContactType of others SSubContact is mobile.

* fix(notify): Unverify SSubContact when ParentContactType match

* fix(notify): When no data is initialized, exit directly
2020-09-02 16:10:38 +08:00
wanyaoqi
20b949091e update host status to unknown on host offline 2020-09-02 13:09:24 +08:00
wanyaoqi
43ce3b5455 vmware disk support deploy lvm partition 2020-09-01 21:15:22 +08:00
zhaoxiangchun
d95e64e593 listfilter by alert_id 2020-09-01 20:47:18 +08:00
zhaoxiangchun
06bd735f0b alert record bugfix
1.return details fix
2020-09-01 20:47:18 +08:00
wanyaoqi
607e3d8fdc hostinfo: try create network add is_on_premise (#7707) 2020-09-01 20:10:37 +08:00
屈轩
800dd26c60 fix: add details for account delete (#7703)
Co-authored-by: Qu Xuan <quxuan@yunionyun.com>
2020-09-01 20:09:47 +08:00
Yousong Zhou
77a5c1ff85 Automated cherry pick of #7712: httperrors: support setting lang with X-Yunion-Lang (#7713)
* httperrors: support setting lang with X-Yunion-Lang

* mcclient: session: set lang
2020-09-01 19:52:38 +08:00
Yousong Zhou
bde5e1b96a httperrors: use existing details if id is not present (#7711) 2020-09-01 18:32:37 +08:00
Zexi Li
82942006b6 Merge pull request #7665 from ioito/automated-cherry-pick-of-#7664-upstream-release-3.4
Automated cherry pick of #7664: fix: avoid delete aws iam user failed
2020-09-01 12:19:25 +08:00
Jian Qiu
836151eee3 fix: vmware esxi host detects vnic portgroup info (#7660)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2020-09-01 10:51:41 +08:00
Jian Qiu
0566e1dec7 fix: apigateway user info add is_local attribtue (#7695)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2020-09-01 10:49:36 +08:00
Rain Zheng
b03c8ce506 Automated cherry pick of #7692: feat(notify): Support update for notify config (#7693)
* feat(notify): Support update for notify config

* fix(notify): Be compatible with the email configuration

Email config key text changed:
mail.username => username
mail.password => password
mail.smtp.hostname => hostname
mail.smtp.hostport => hostport

* fix(notify): Give users permission to operate receiver

* fix(notify): Allow negative update for receiver

Now, input.Email and input.Mobile can be empty which means
that do not update the corresponding field.

* feat(notify): Support for triggering validation on feishu, dingtalk and worwx

Triggering validation on these contact types means repulling a Contact about them.

* feat(notify): Adds validity period for verify

Verification beyond the expiration date will fail.

* fix(notify): SQuery of scopedomain in FilterByOwner
2020-09-01 10:48:37 +08:00
Rain Zheng
c914dafa75 Automated cherry pick of #7661: fix(host-deployer): Exit correctly after mounting (#7672)
* fix(esxi): Fetch full templates of datastoreImageCache

Datastore 和 DatastoreImageCache 是一对一的关系。
每一个 Datastore 可能有多个对应的 Host,所以 GetIIMages 里面获取
Templates 的逻辑应该尝试去获取所有 Host 的 Templates。

* fix(host-deployer): Exit correctly after mounting

MountRootfs的返回值为nil时,还是需要Umount的操作来正确退出(比如VDDK)。
VDDK的Mount分为两步,第一步会挂在remote
disk到fuse下,然后挂载fuse/xxx/flat
到块设备上。第一步成功,第二部失败也应该正确退出。

* fix(host-deployer): Kill process

* opt(host-deployer): Increase timeout of waiting mount

* opt(host-deployer): Add debug log print command to mount

* fix(esxi): Support multi agent in different zone
2020-09-01 10:47:39 +08:00
Zexi Li
6c30c1c789 Merge pull request #7681 from wanyaoqi/automated-cherry-pick-of-#7680-upstream-release-3.4
Automated cherry pick of #7680: snapshot list by guest
2020-09-01 10:47:14 +08:00
Zexi Li
adf8885a7a Merge pull request #7671 from zhaoxiangchun/automated-cherry-pick-of-#7667-upstream-release-3.4
Automated cherry pick of #7667: monitor commonalert bugfix
2020-09-01 10:46:24 +08:00
Jian Qiu
cca2267389 fix: server purge may fail (#7698)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2020-09-01 10:33:06 +08:00
Jian Qiu
538bc873a0 fix: http error limit request body length fix: http error limit request body length (#7700)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2020-09-01 10:18:36 +08:00
屈轩
9812864bce fix: 不限制openstack系统盘类型 (#7675)
Co-authored-by: Qu Xuan <quxuan@yunionyun.com>
2020-09-01 01:24:36 +08:00
wanyaoqi
4af4bcb963 fix host get guests (#7683) 2020-09-01 01:14:09 +08:00
wanyaoqi
b85fb98297 fix get storage capacity on init' (#7687) 2020-09-01 01:03:37 +08:00
Yousong Zhou
19ba4b9755 vpcagent: respect guest src check settings (#7678)
mac   ip    dhcp    ping    xipping    xmacping
  on    on    y       y       n          n
  on    off   y       y       y          n
  off   off   y       y       y          y

external access depends on source routing, changing ip address will
fail that

note dst mac address of reply packet when changing only mac address
with vpc ip remains the same
2020-08-31 16:39:37 +08:00
wanyaoqi
438c1ced5f snapshot list by guest 2020-08-31 15:27:27 +08:00
zhaoxiangchun
be5bf11ebe commonalert bugfix 2020-08-31 10:28:23 +08:00
zhaoxiangchun
6cea2883ab 统一监控查询面板保存 2020-08-31 10:28:23 +08:00
Jian Qiu
5647a6842d fix: cleanup logic for nics of pending_deleted guests (#7669)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2020-08-31 09:33:35 +08:00
Zexi Li
fba76c6392 Merge pull request #7663 from wanyaoqi/automated-cherry-pick-of-#7662-upstream-release-3.4
Automated cherry pick of #7662: update host deployer base image version
2020-08-28 20:36:42 +08:00
Qu Xuan
6ed3a48333 fix: avoid delete aws iam user failed 2020-08-28 20:24:53 +08:00
wanyaoqi
53a6c40a8a update host deployer base image version 2020-08-28 20:19:15 +08:00
wanyaoqi
eee193165e baremetal colloct isolated devices info (#7658) 2020-08-28 12:10:34 +08:00
Zexi Li
5987b56297 Merge pull request #7652 from tb365/automated-cherry-pick-of-#7650-upstream-release-3.4
Automated cherry pick of #7650: eip & vpc manager match fix
2020-08-28 12:09:20 +08:00
wanyaoqi
8e83ab4768 fix mount fetcher fs (#7657) 2020-08-28 12:08:35 +08:00
wanyaoqi
b977641336 remove backup metadata on delete backup (#7654) 2020-08-28 12:01:37 +08:00
TangBin
132c583790 eip & vpc manager match fix 2020-08-28 10:20:24 +08:00
wanyaoqi
557240155d fix build baremetal agent image (#7647) 2020-08-27 11:02:34 +08:00
屈轩
3243e5a035 fix: aovid truncated data (#7644)
Co-authored-by: Qu Xuan <quxuan@yunionyun.com>
2020-08-26 21:45:34 +08:00
Jian Qiu
e3fe66e8eb fix: add keystone sync user debug info (#7639)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2020-08-26 18:42:37 +08:00
Jian Qiu
de80f17053 fix: turn off some default project policies (#7637)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
2020-08-26 18:41:35 +08:00
屈轩
aef249ea8e fix: avoid openstack image-list failed (#7641)
Co-authored-by: Qu Xuan <quxuan@yunionyun.com>
2020-08-26 18:33:33 +08:00
3323 changed files with 202078 additions and 301499 deletions

View File

@@ -1,7 +0,0 @@
_output/alpine-build/_cache
pkg
vendor
cmd
locales
docs
scripts

1
.gitignore vendored
View File

@@ -31,7 +31,6 @@ _output
/structargtest
.idea
.vscode
intellij.yaml
GPATH
GRTAGS
GTAGS

View File

@@ -9,7 +9,7 @@ BUILD_SCRIPT := $(ROOT_DIR)/build/build.sh
ifeq ($(ONECLOUD_CI_BUILD),)
GIT_COMMIT := $(shell git rev-parse --short HEAD)
GIT_BRANCH := $(shell git branch -r --contains | head -1 | sed -E -e "s%(HEAD ->|origin|upstream)/?%%g" | xargs)
GIT_BRANCH := $(shell git name-rev --name-only HEAD)
GIT_VERSION := $(shell git describe --always --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')
@@ -199,7 +199,7 @@ mod:
go mod vendor -v
DOCKER_CENTOS_BUILD_IMAGE?=registry.cn-beijing.aliyuncs.com/yunionio/centos-build:1.1-3
DOCKER_CENTOS_BUILD_IMAGE?=registry.cn-beijing.aliyuncs.com/yunionio/centos-build:1.1-1
define dockerCentOSBuildCmd
set -o xtrace
@@ -232,7 +232,7 @@ docker-centos-build-stop:
.PHONY: docker-centos-build
.PHONY: docker-centos-build-stop
DOCKER_ALPINE_BUILD_IMAGE?=registry.cn-beijing.aliyuncs.com/yunionio/alpine-build:1.0-5
DOCKER_ALPINE_BUILD_IMAGE?=registry.cn-beijing.aliyuncs.com/yunionio/alpine-build:1.0-3
define dockerAlpineBuildCmd
set -o xtrace

View File

@@ -41,7 +41,7 @@
## 架构
![architecture](https://www.yunion.cn/static/frame.png)
![architecture](./docs/architecture.svg)
## 贡献

View File

@@ -44,7 +44,7 @@ Please refers to [install & deployment](https://docs.yunion.io/docs/setup/) (cur
## Architecture
![architecture](https://www.yunion.cn/static/frame.png)
![architecture](./docs/architecture.svg)
## Contribution

View File

@@ -0,0 +1,6 @@
# rbac for project owner, not allow for delete
roles:
- domain_admin
scope: domain
policy:
'*': allow

View File

@@ -1,10 +1,9 @@
# rbac for normal user, not allow for delete
scope: project
policy:
'*':
'*':
'*': allow
create: deny
update: deny
delete: deny
perform:
purge: deny
clone: deny
'*': allow

View File

@@ -1,2 +0,0 @@
policy:
'*': allow

View File

@@ -0,0 +1,6 @@
# rbac for project owner, not allow for delete
roles:
- project_owner
scope: project
policy:
'*': allow

View File

@@ -0,0 +1,8 @@
# rbac for sysadmin
projects:
- system
roles:
- admin
scope: system
policy:
'*': allow

View File

@@ -1,6 +0,0 @@
policy:
'*':
'*':
get: allow
list: allow
'*': deny

View File

@@ -1,6 +0,0 @@
公有云子账号创建成功
主账号:{{ .account }}<br>
名称:{{ .name }}<br>
密码:{{ .password }}<br>
登录地址: {{ .iam_login_url }}<br>
资源ID: {{ .id }}<br>

View File

@@ -1,6 +0,0 @@
Clouduser has been created successfully
Root Account: {{ .account }}<br>
Name{{ .name }}<br>
Password{{ .password }}<br>
IAM Login URL: {{ .iam_login_url }}<br>
Resource ID: {{ .id }}<br>

View File

@@ -1 +0,0 @@
公有云子账号 {{ .name }} 创建成功

View File

@@ -1 +0,0 @@
The clouduser {{ .name }} created successfully

View File

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

View File

@@ -0,0 +1,16 @@
FROM registry.cn-beijing.aliyuncs.com/yunionio/alpine-build:1.0-3 as build
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN mkdir -p /root/go/src/yunion.io/x/onecloud
COPY . /root/go/src/yunion.io/x/onecloud
WORKDIR /root/go/src/yunion.io/x/onecloud
RUN make cmd/esxi-agent
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:v0.2
MAINTAINER "Yaoqi Wan wanyaoqi@yunionyun.com"
RUN mkdir -p /opt/yunion/bin
COPY --from=build /root/go/src/yunion.io/x/onecloud/build/esxi-agent/root/opt/ /opt/
COPY --from=build /root/go/src/yunion.io/x/onecloud/_output/bin/esxi-agent /opt/yunion/bin/esxi-agent

View File

@@ -1,4 +1,4 @@
FROM registry.cn-beijing.aliyuncs.com/yunionio/alpine-build:1.0-5 as build
FROM registry.cn-beijing.aliyuncs.com/yunionio/alpine-build:1.0-3 as build
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN mkdir -p /root/go/src/yunion.io/x/onecloud

View File

@@ -1,4 +1,4 @@
FROM registry.cn-beijing.aliyuncs.com/yunionio/alpine-build:1.0-5 as build
FROM registry.cn-beijing.aliyuncs.com/yunionio/alpine-build:1.0-3 as build
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN mkdir -p /root/go/src/yunion.io/x/onecloud

View File

@@ -0,0 +1,18 @@
## {{.title}}
- 时间: {{.start_time}}
- 级别: {{.level}}
- 详情地址: {{.web_url}}/commonalerts
{{ range .matches}}
- 指标: {{.metric}}
- 触发值: {{html .value_str}}
### 触发条件:
- {{html $.description}}
### 标签
> 名称: {{ index .tags "name" }}
> ip: {{ index .tags "ip" }}
> 平台: {{ index .tags "brand" }}
------
{{- end}}

View File

@@ -92,7 +92,7 @@
</table>
<table class="table" style="padding-top: 6px; padding-bottom: 10px;">
<tr>
<td style="padding-left: 20px; font-size: 14px;">若要查看详情信息,<a class="link" target="_blank" href="{{.web_url}}
<td style="padding-left: 20px; font-size: 14px;">若要查看详情信息,<a class="link" target="_blank" href="{{.web_url}}/commonalerts
">请登录平台进行查看</a></td>
</tr>
</table>

View File

@@ -0,0 +1,18 @@
## {{.title}}
- Time: {{.start_time}}
- Level: {{.level}}
- WebUrl: {{.web_url}}/commonalerts
{{ range .matches}}
- Metric: {{.metric}}
- Trigger value: {{html .value_str}}
### Trigger condition:
- {{html $.description }}
### Label
> Name: {{ index .tags "name" }}
> IP: {{ index .tags "ip" }}
> Brand: {{ index .tags "brand" }}
------
{{- end}}

View File

@@ -33,7 +33,7 @@
font-weight: bold;
}
.td {
width: 120px;
width: 80px;
padding-left: 20px;
height: 35px;
font-weight: 400;
@@ -92,8 +92,8 @@
</table>
<table class="table" style="padding-top: 6px; padding-bottom: 10px;">
<tr>
<td style="padding-left: 20px; font-size: 14px;">To view details<a class="link" target="_blank" href="{{.web_url}}
">Please login to the platform to view</a></td>
<td style="padding-left: 20px; font-size: 14px;">To view details<a class="link" target="_blank" href="{{.web_url}}/commonalerts
">Please log in to the platform to view</a></td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" class="table pb-3">

View File

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

View File

@@ -1,9 +0,0 @@
{{.title}}
AlertName: {{.name}}
Time: {{.start_time}}
Level: {{.level}}
TriggerCondition: {{.description | unescaped}}
ResourceCount: {{len .matches}}
ResourceName: {{.resource_name}}
WebUrl: {{.web_url}}

View File

@@ -47,7 +47,7 @@
</td>
</tr>
<tr>
<td style="padding-bottom: 10px;">您正在验证邮箱,请在验证码输入框中输入:{{.code}}完成验证。</td>
<td style="padding-bottom: 10px;">您正在验证邮箱,请在验证码输入框中输入:{{.code}}完成验证。</td>
</tr>
</table>
</td>

View File

@@ -1 +0,0 @@
{{.os_type}} image {{.name}} upload completed

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;">Product</a>
</td>
<td style="padding-left: 20px; padding-right: 20px;">
<a href="" style="text-decoration: none; color: #20A0FF; font-size: 12px; display: none;">Solution</a>
</td>
<td style="padding-left: 20px; padding-right: 20px;">
<a href="" style="text-decoration: none; color: #20A0FF; font-size: 12px; display: none;">Service</a>
</td>
<td style="padding-left: 20px; padding-right: 20px;">
<a href="" style="text-decoration: none; color: #20A0FF; font-size: 12px; display: none;">Help and Documentation</a>
</td>
<td style="padding-left: 20px; padding-right: 20px;">
<a href="" style="text-decoration: none; color: #20A0FF; font-size: 12px; display: none;">About</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: 13px;">
Dear {{.name}}
</td>
</tr>
<tr>
<td style="padding-bottom: 13px;">You are verifying your email, please enter the following code on the email verification page:</td>
</tr>
<tr>
<td style="padding-bottom: 10px; font-size: large">{{.code}}</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;">If you are not operating by yourself, please log in to the platform in time and change your password to ensure the security of your account.</td>
</tr>
<tr>
<td colspan="2" style="background: #333; text-align: right; padding-right: 20px; font-size: 12px; color: #fff; height: 50px;">Copyrights © {{.copyright}}. All rights reserved.</td>
</tr>
</table>
</body>
</html>

View File

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

View File

@@ -1 +0,0 @@
{{.copyright}} Verify

View File

@@ -1 +0,0 @@
Image {{.name}} upload completed

View File

@@ -1 +0,0 @@
{{.copyright}} Verify

View File

@@ -1,146 +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 (
"fmt"
"os"
"yunion.io/x/structarg"
"yunion.io/x/onecloud/pkg/cloudprovider"
"yunion.io/x/onecloud/pkg/multicloud/apsara"
_ "yunion.io/x/onecloud/pkg/multicloud/apsara/shell"
"yunion.io/x/onecloud/pkg/util/shellutils"
)
type BaseOptions struct {
Debug bool `help:"debug mode"`
Help bool `help:"Show help"`
AccessKey string `help:"Access key" default:"$APSARA_ACCESS_KEY" metavar:"APSARA_ACCESS_KEY"`
Secret string `help:"Secret" default:"$APSARA_SECRET" metavar:"APSARA_SECRET"`
cloudprovider.SApsaraEndpoints `help:"Endpoints for Apsara"`
Endpoint string `help:"Apsara endpoint" default:"$APSARA_ENDPOINT" metavar:"APSARA_ENDPOINT"`
RegionId string `help:"RegionId" default:"$APSARA_REGION" metavar:"APSARA_REGION"`
SUBCOMMAND string `help:"apsaracli subcommand" subcommand:"true"`
}
func getSubcommandParser() (*structarg.ArgumentParser, error) {
parse, e := structarg.NewArgumentParser(&BaseOptions{},
"apsaracli",
"Command-line interface to apsara API.",
`See "apsaracli help COMMAND" for help on a specific command.`)
if e != nil {
return nil, e
}
subcmd := parse.GetSubcommand()
if subcmd == nil {
return nil, fmt.Errorf("No subcommand argument.")
}
type HelpOptions struct {
SUBCOMMAND string `help:"sub-command name"`
}
shellutils.R(&HelpOptions{}, "help", "Show help of a subcommand", func(args *HelpOptions) error {
helpstr, e := subcmd.SubHelpString(args.SUBCOMMAND)
if e != nil {
return e
} else {
fmt.Print(helpstr)
return nil
}
})
for _, v := range shellutils.CommandTable {
_, e := subcmd.AddSubParser(v.Options, v.Command, v.Desc, v.Callback)
if e != nil {
return nil, e
}
}
return parse, nil
}
func showErrorAndExit(e error) {
fmt.Fprintf(os.Stderr, "%s", e)
fmt.Fprintln(os.Stderr)
os.Exit(1)
}
func newClient(options *BaseOptions) (*apsara.SRegion, error) {
if len(options.AccessKey) == 0 {
return nil, fmt.Errorf("Missing accessKey")
}
if len(options.Secret) == 0 {
return nil, fmt.Errorf("Missing secret")
}
cli, err := apsara.NewApsaraClient(
apsara.NewApsaraClientConfig(
options.AccessKey,
options.Secret,
options.Endpoint,
options.SApsaraEndpoints,
).Debug(options.Debug),
)
if err != nil {
return nil, err
}
region := cli.GetRegion(options.RegionId)
if region == nil {
return nil, fmt.Errorf("No such region %s", options.RegionId)
}
return region, nil
}
func main() {
parser, e := getSubcommandParser()
if e != nil {
showErrorAndExit(e)
}
e = parser.ParseArgs(os.Args[1:], false)
options := parser.Options().(*BaseOptions)
if options.Help {
fmt.Print(parser.HelpString())
return
}
subcmd := parser.GetSubcommand()
subparser := subcmd.GetSubParser()
if e != nil {
if subparser != nil {
fmt.Print(subparser.Usage())
} else {
fmt.Print(parser.Usage())
}
showErrorAndExit(e)
}
suboptions := subparser.Options()
if options.SUBCOMMAND == "help" {
e = subcmd.Invoke(suboptions)
} else {
var region *apsara.SRegion
region, e = newClient(options)
if e != nil {
showErrorAndExit(e)
}
e = subcmd.Invoke(region, suboptions)
}
if e != nil {
showErrorAndExit(e)
}
}

View File

@@ -34,7 +34,6 @@ import (
_ "yunion.io/x/onecloud/cmd/climc/shell/monitor"
_ "yunion.io/x/onecloud/cmd/climc/shell/notifyv2"
_ "yunion.io/x/onecloud/cmd/climc/shell/servicetree"
_ "yunion.io/x/onecloud/cmd/climc/shell/suggestion"
_ "yunion.io/x/onecloud/cmd/climc/shell/yunionconf"
)

View File

@@ -17,22 +17,22 @@ package cloudid
import (
"yunion.io/x/onecloud/cmd/climc/shell"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options/cloudid"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func init() {
cmd := shell.NewResourceCmd(&modules.Cloudgroups).WithKeyword("cloud-group")
cmd.List(&cloudid.CloudgroupListOptions{})
cmd.Create(&cloudid.CloudgroupCreateOptions{})
cmd.Show(&cloudid.CloudgroupIdOptions{})
cmd.Delete(&cloudid.CloudgroupIdOptions{})
cmd.Perform("syncstatus", &cloudid.CloudgroupIdOptions{})
cmd.Perform("attach-policy", &cloudid.CloudgroupPolicyOptions{})
cmd.Perform("detach-policy", &cloudid.CloudgroupPolicyOptions{})
cmd.Perform("add-user", &cloudid.CloudgroupUserOptions{})
cmd.Perform("remove-user", &cloudid.CloudgroupUserOptions{})
cmd.Perform("set-policies", &cloudid.CloudgroupPolicyOptions{})
cmd.Perform("set-users", &cloudid.CloudgroupUserOptions{})
cmd.Perform("public", &cloudid.CloudgroupPublicOptions{})
cmd.Perform("private", &cloudid.CloudgroupIdOptions{})
cmd.List(&options.CloudgroupListOptions{})
cmd.Create(&options.CloudgroupCreateOptions{})
cmd.Show(&options.CloudgroupIdOptions{})
cmd.Delete(&options.CloudgroupIdOptions{})
cmd.Perform("syncstatus", &options.CloudgroupIdOptions{})
cmd.Perform("attach-policy", &options.CloudgroupPolicyOptions{})
cmd.Perform("detach-policy", &options.CloudgroupPolicyOptions{})
cmd.Perform("add-user", &options.CloudgroupUserOptions{})
cmd.Perform("remove-user", &options.CloudgroupUserOptions{})
cmd.Perform("set-policies", &options.CloudgroupPolicyOptions{})
cmd.Perform("set-users", &options.CloudgroupUserOptions{})
cmd.Perform("public", &options.CloudgroupPublicOptions{})
cmd.Perform("private", &options.CloudgroupIdOptions{})
}

View File

@@ -15,15 +15,59 @@
package cloudid
import (
"yunion.io/x/onecloud/cmd/climc/shell"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options/cloudid"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func init() {
cmd := shell.NewResourceCmd(&modules.Cloudgroupcaches).WithKeyword("cloud-group-cache")
cmd.List(&cloudid.CloudgroupcacheListOptions{})
cmd.Show(&cloudid.CloudgroupcacheIdOption{})
cmd.Delete(&cloudid.CloudgroupcacheIdOption{})
cmd.Perform("syncstatus", &cloudid.CloudgroupcacheIdOption{})
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

@@ -15,12 +15,58 @@
package cloudid
import (
"yunion.io/x/onecloud/cmd/climc/shell"
"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/cloudid"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func init() {
cmd := shell.NewResourceCmd(&modules.Cloudgrouppolicies).WithKeyword("cloud-group-policy").WithContextManager(&modules.Cloudgroups)
cmd.List(&cloudid.CloudgroupPolicyListOptions{})
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

@@ -15,12 +15,58 @@
package cloudid
import (
"yunion.io/x/onecloud/cmd/climc/shell"
"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/cloudid"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func init() {
cmd := shell.NewResourceCmd(&modules.Cloudgroupusers).WithKeyword("cloud-group-user").WithContextManager(&modules.Cloudusers)
cmd.List(&cloudid.CloudgroupUserListOptions{})
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

@@ -17,18 +17,18 @@ package cloudid
import (
"yunion.io/x/onecloud/cmd/climc/shell"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options/cloudid"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func init() {
cmd := shell.NewResourceCmd(&modules.Cloudpolicies).WithKeyword("cloud-policy")
cmd.Create(&cloudid.CloudpolicyListOptions{})
cmd.List(&cloudid.CloudpolicyListOptions{})
cmd.Show(&cloudid.CloudpolicyIdOptions{})
cmd.Update(&cloudid.CloudpolicyUpdateOption{})
cmd.Perform("syncstauts", &cloudid.CloudpolicyIdOptions{})
cmd.Perform("lock", &cloudid.CloudpolicyIdOptions{})
cmd.Perform("unlock", &cloudid.CloudpolicyIdOptions{})
cmd.Perform("assign-group", &cloudid.CloudpolicyGroupOptions{})
cmd.Perform("revoke-group", &cloudid.CloudpolicyGroupOptions{})
cmd.Create(&options.CloudpolicyListOptions{})
cmd.List(&options.CloudpolicyListOptions{})
cmd.Show(&options.CloudpolicyIdOptions{})
cmd.Update(&options.CloudpolicyUpdateOption{})
cmd.Perform("syncstauts", &options.CloudpolicyIdOptions{})
cmd.Perform("lock", &options.CloudpolicyIdOptions{})
cmd.Perform("unlock", &options.CloudpolicyIdOptions{})
cmd.Perform("assign-group", &options.CloudpolicyGroupOptions{})
cmd.Perform("revoke-group", &options.CloudpolicyGroupOptions{})
}

View File

@@ -15,12 +15,28 @@
package cloudid
import (
"yunion.io/x/onecloud/cmd/climc/shell"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options/cloudid"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func init() {
cmd := shell.NewResourceCmd(&modules.Cloudpolicycaches).WithKeyword("cloud-policy-cache")
cmd.List(&cloudid.CloudpolicycacheListOptions{})
type CloudpolicycacheListOptions struct {
options.BaseListOptions
CloudpolyId string
CloudaccountId string
}
R(&CloudpolicycacheListOptions{}, "cloud-policy-cache-list", "List cloud policy caches", func(s *mcclient.ClientSession, opts *CloudpolicycacheListOptions) error {
params, err := options.ListStructToParams(opts)
if err != nil {
return err
}
result, err := modules.Cloudpolicycaches.List(s, params)
if err != nil {
return err
}
printList(result, modules.Cloudpolicycaches.GetColumns(s))
return nil
})
}

View File

@@ -1,29 +0,0 @@
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package cloudid
import (
"yunion.io/x/onecloud/cmd/climc/shell"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options/cloudid"
)
func init() {
cmd := shell.NewResourceCmd(&modules.Cloudroles).WithKeyword("cloud-role")
cmd.List(&cloudid.CloudroleListOptions{})
cmd.Delete(&cloudid.CloudroleIdOptions{})
cmd.Show(&cloudid.CloudroleIdOptions{})
cmd.Perform("purge", &cloudid.CloudroleIdOptions{})
}

View File

@@ -15,12 +15,58 @@
package cloudid
import (
"yunion.io/x/onecloud/cmd/climc/shell"
"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/cloudid"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func init() {
cmd := shell.NewResourceCmd(&modules.Clouduserpolicies).WithKeyword("cloud-user-policy").WithContextManager(&modules.Cloudpolicies)
cmd.List(&cloudid.ClouduserPolicyListOptions{})
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

@@ -17,22 +17,22 @@ package cloudid
import (
"yunion.io/x/onecloud/cmd/climc/shell"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options/cloudid"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func init() {
cmd := shell.NewResourceCmd(&modules.Cloudusers).WithKeyword("cloud-user")
cmd.List(&cloudid.ClouduserListOptions{})
cmd.Create(&cloudid.ClouduserCreateOptions{})
cmd.Show(&cloudid.ClouduserIdOption{})
cmd.Custom(shell.CustomActionGet, "login-info", &cloudid.ClouduserIdOption{})
cmd.Delete(&cloudid.ClouduserIdOption{})
cmd.Perform("sync", &cloudid.ClouduserSyncOptions{})
cmd.Perform("syncstatus", &cloudid.ClouduserIdOption{})
cmd.Perform("attach-policy", &cloudid.ClouduserPolicyOptions{})
cmd.Perform("detach-policy", &cloudid.ClouduserPolicyOptions{})
cmd.Perform("change-owner", &cloudid.ClouduserChangeOwnerOptions{})
cmd.Perform("reset-password", &cloudid.ClouduserResetPasswordOptions{})
cmd.Perform("cloud-user-join-group", &cloudid.ClouduserGroupOptions{})
cmd.Perform("cloud-user-leave-group", &cloudid.ClouduserGroupOptions{})
cmd.List(&options.ClouduserListOptions{})
cmd.Create(&options.ClouduserCreateOptions{})
cmd.Show(&options.ClouduserIdOption{})
cmd.Custom(shell.CustomActionGet, "login-info", &options.ClouduserIdOption{})
cmd.Delete(&options.ClouduserIdOption{})
cmd.Perform("sync", &options.ClouduserSyncOptions{})
cmd.Perform("syncstatus", &options.ClouduserIdOption{})
cmd.Perform("attach-policy", &options.ClouduserPolicyOptions{})
cmd.Perform("detach-policy", &options.ClouduserPolicyOptions{})
cmd.Perform("change-owner", &options.ClouduserChangeOwnerOptions{})
cmd.Perform("reset-password", &options.ClouduserResetPasswordOptions{})
cmd.Perform("cloud-user-join-group", &options.ClouduserGroupOptions{})
cmd.Perform("cloud-user-leave-group", &options.ClouduserGroupOptions{})
}

View File

@@ -1,29 +0,0 @@
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package cloudid
import (
"yunion.io/x/onecloud/cmd/climc/shell"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options/cloudid"
)
func init() {
cmd := shell.NewResourceCmd(&modules.SAMLProviders).WithKeyword("saml-provider")
cmd.List(&cloudid.SAMLProviderListOptions{})
cmd.Create(&cloudid.SAMLProviderCreateOptions{})
cmd.Show(&cloudid.SAMLProviderIdOptions{})
cmd.Delete(&cloudid.SAMLProviderIdOptions{})
}

View File

@@ -1,29 +0,0 @@
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package cloudid
import (
"yunion.io/x/onecloud/cmd/climc/shell"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options/cloudid"
)
func init() {
cmd := shell.NewResourceCmd(&modules.Samlusers).WithKeyword("saml-user")
cmd.List(&cloudid.SamluserListOptions{})
cmd.Create(&cloudid.SamluserCreateOptions{})
cmd.Show(&cloudid.SamluserIdOptions{})
cmd.Delete(&cloudid.SamluserIdOptions{})
}

View File

@@ -342,209 +342,4 @@ func init() {
printObject(result)
return nil
})
type BucketSetWebsiteOption struct {
ID string `help:"ID or name of bucket" json:"-"`
// 主页
Index string `help:"main page"`
// 错误时返回的文档
ErrorDocument string `help:"error return"`
// http或https
Protocol string `help:"force https" choices:"http|https"`
}
R(&BucketSetWebsiteOption{}, "bucket-set-website", "Set bucket website", func(s *mcclient.ClientSession, args *BucketSetWebsiteOption) error {
conf := api.BucketWebsiteConf{
Index: args.Index,
ErrorDocument: args.ErrorDocument,
Protocol: args.Protocol,
}
result, err := modules.Buckets.PerformAction(s, args.ID, "set-website", jsonutils.Marshal(conf))
if err != nil {
return err
}
printObject(result)
return nil
})
type BucketGetWebsiteConfOption struct {
ID string `help:"ID or name of bucket" json:"-"`
}
R(&BucketGetWebsiteConfOption{}, "bucket-get-website", "Get bucket website", func(s *mcclient.ClientSession, args *BucketGetWebsiteConfOption) error {
result, err := modules.Buckets.GetSpecific(s, args.ID, "website", nil)
if err != nil {
return err
}
printObject(result)
return nil
})
type BucketDeleteWebsiteConfOption struct {
ID string `help:"ID or name of bucket" json:"-"`
}
R(&BucketDeleteWebsiteConfOption{}, "bucket-delete-website", "Delete bucket website", func(s *mcclient.ClientSession, args *BucketDeleteWebsiteConfOption) error {
result, err := modules.Buckets.PerformAction(s, args.ID, "delete-website", nil)
if err != nil {
return err
}
printObject(result)
return nil
})
type BucketSetCorsOption struct {
ID string `help:"ID or name of bucket" json:"-"`
AllowedMethods []string `help:"allowed http method" choices:"PUT|GET|POST|DELETE|HEAD"`
// 允许的源站,可以设为*
AllowedOrigins []string
AllowedHeaders []string
MaxAgeSeconds int
ExposeHeaders []string
RuleId string
}
R(&BucketSetCorsOption{}, "bucket-set-cors", "Set bucket cors", func(s *mcclient.ClientSession, args *BucketSetCorsOption) error {
rule := api.BucketCORSRule{
AllowedOrigins: args.AllowedOrigins,
AllowedMethods: args.AllowedMethods,
AllowedHeaders: args.AllowedHeaders,
MaxAgeSeconds: args.MaxAgeSeconds,
ExposeHeaders: args.ExposeHeaders,
Id: args.RuleId,
}
rules := api.BucketCORSRules{Data: []api.BucketCORSRule{rule}}
result, err := modules.Buckets.PerformAction(s, args.ID, "set-cors", jsonutils.Marshal(rules))
if err != nil {
return err
}
printObject(result)
return nil
})
type BucketGetCorsOption struct {
ID string `help:"ID or name of bucket" json:"-"`
}
R(&BucketGetCorsOption{}, "bucket-get-cors", "Get bucket cors", func(s *mcclient.ClientSession, args *BucketGetCorsOption) error {
result, err := modules.Buckets.GetSpecific(s, args.ID, "cors", nil)
if err != nil {
return err
}
printObject(result)
return nil
})
type BucketDeleteCorsOption struct {
ID string `help:"ID or name of bucket" json:"-"`
Id []string `"help:Id of rules to delete"`
}
R(&BucketDeleteCorsOption{}, "bucket-delete-cors", "Delete bucket cors", func(s *mcclient.ClientSession, args *BucketDeleteCorsOption) error {
input := api.BucketCORSRuleDeleteInput{}
input.Id = args.Id
result, err := modules.Buckets.PerformAction(s, args.ID, "delete-cors", jsonutils.Marshal(input))
if err != nil {
return err
}
printObject(result)
return nil
})
type BucketSetRefererOption struct {
ID string `help:"ID or name of bucket" json:"-"`
// 域名列表
DomainList []string
// 是否允许空referer 访问
AllowEmptyRefer bool `help:"all empty refer access"`
}
R(&BucketSetRefererOption{}, "bucket-set-referer", "Set bucket referer", func(s *mcclient.ClientSession, args *BucketSetRefererOption) error {
conf := api.BucketRefererConf{
WhiteList: args.DomainList,
AllowEmptyRefer: args.AllowEmptyRefer,
}
result, err := modules.Buckets.PerformAction(s, args.ID, "set-referer", jsonutils.Marshal(conf))
if err != nil {
return err
}
printObject(result)
return nil
})
type BucketGetRefererOption struct {
ID string `help:"ID or name of bucket" json:"-"`
}
R(&BucketGetRefererOption{}, "bucket-get-referer", "get bucket referer", func(s *mcclient.ClientSession, args *BucketGetRefererOption) error {
result, err := modules.Buckets.GetSpecific(s, args.ID, "referer", nil)
if err != nil {
return err
}
printObject(result)
return nil
})
type BucketGetCdnDomainOption struct {
ID string `help:"ID or name of bucket" json:"-"`
}
R(&BucketGetRefererOption{}, "bucket-get-cdn-domain", "get bucket cdn domain", func(s *mcclient.ClientSession, args *BucketGetRefererOption) error {
result, err := modules.Buckets.GetSpecific(s, args.ID, "cdn-domain", nil)
if err != nil {
return err
}
printObject(result)
return nil
})
type BucketGetPolicyOption struct {
ID string `help:"ID or name of bucket" json:"-"`
}
R(&BucketGetPolicyOption{}, "bucket-get-policy", "get bucket policy", func(s *mcclient.ClientSession, args *BucketGetPolicyOption) error {
result, err := modules.Buckets.GetSpecific(s, args.ID, "policy", nil)
if err != nil {
return err
}
printObject(result)
return nil
})
type BucketSetPolicyOption struct {
ID string `help:"ID or name of bucket" json:"-"`
// 格式主账号id:子账号id
PrincipalId []string `help:"ext account id, accountId:subaccountId"`
// Read|ReadWrite|FullControl
CannedAction string `help:"authority action" choice:"Read|FullControl"`
// Allow|Deny
Effect string `help:"allow or deny" choice:"Allow|Deny"`
// 被授权的资源地址
ResourcePath []string
// ip 条件
IpEquals []string
IpNotEquals []string
}
R(&BucketSetPolicyOption{}, "bucket-set-policy", "set bucket policy", func(s *mcclient.ClientSession, args *BucketSetPolicyOption) error {
opts := api.BucketPolicyStatementInput{}
opts.CannedAction = args.CannedAction
opts.Effect = args.Effect
opts.IpEquals = args.IpEquals
opts.IpNotEquals = args.IpNotEquals
opts.ResourcePath = args.ResourcePath
opts.PrincipalId = args.PrincipalId
result, err := modules.Buckets.PerformAction(s, args.ID, "set-policy", jsonutils.Marshal(opts))
if err != nil {
return err
}
printObject(result)
return nil
})
type BucketDeletePolicyOption struct {
ID string `help:"ID or name of bucket" json:"-"`
Id []string
}
R(&BucketDeletePolicyOption{}, "bucket-delete-policy", "delete bucket policy", func(s *mcclient.ClientSession, args *BucketDeletePolicyOption) error {
input := api.BucketPolicyDeleteInput{}
input.Id = args.Id
result, err := modules.Buckets.PerformAction(s, args.ID, "delete-policy", jsonutils.Marshal(input))
if err != nil {
return err
}
printObject(result)
return nil
})
}

File diff suppressed because it is too large Load Diff

View File

@@ -235,7 +235,7 @@ func init() {
return err
}
for k, v := range rc {
fmt.Printf(`export %s="%s"`+"\n", k, v)
fmt.Printf("export %s='%s'\n", k, v)
}
return nil
})

View File

@@ -19,7 +19,6 @@ import (
"yunion.io/x/jsonutils"
"yunion.io/x/onecloud/cmd/climc/shell"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modulebase"
"yunion.io/x/onecloud/pkg/mcclient/modules"
@@ -27,23 +26,6 @@ import (
)
func init() {
cmd := shell.NewResourceCmd(&modules.Cloudregions).WithKeyword("cloud-region")
cmd.PerformClass("sync-skus", &options.CloudregionSkuSyncOptions{})
R(&options.SkuTaskQueryOptions{}, "cloud-region-sync-task-show", "Show details of skus sync tasks", func(s *mcclient.ClientSession, args *options.SkuTaskQueryOptions) error {
params, err := args.Params()
if err != nil {
return err
}
result, err := modules.Cloudregions.Get(s, "sync-tasks", params)
if err != nil {
return err
}
printObject(result)
return nil
})
type CloudregionListOptions struct {
options.BaseListOptions

View File

@@ -15,15 +15,50 @@
package compute
import (
"yunion.io/x/onecloud/cmd/climc/shell"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func init() {
cmd := shell.NewResourceCmd(&modules.DBInstanceAccounts).WithKeyword("dbinstance-account")
cmd.List(&options.DBInstanceAccountListOptions{})
cmd.Update(&options.BaseUpdateOptions{})
cmd.Show(&options.DBInstanceAccountIdOptions{})
cmd.Delete(&options.DBInstanceAccountIdOptions{})
type DBInstanceAccountListOptions struct {
options.BaseListOptions
DBInstance string `help:"ID or Name of DBInstance" json:"dbinstance"`
}
R(&DBInstanceAccountListOptions{}, "dbinstance-account-list", "List DB instance accounts", func(s *mcclient.ClientSession, opts *DBInstanceAccountListOptions) error {
params, err := options.ListStructToParams(opts)
if err != nil {
return err
}
result, err := modules.DBInstanceAccounts.List(s, params)
if err != nil {
return err
}
printList(result, modules.DBInstanceAccounts.GetColumns(s))
return nil
})
type DBInstanceAccountIdOptions struct {
ID string `help:"ID or Name of DBInstanceaccount"`
}
R(&DBInstanceAccountIdOptions{}, "dbinstance-account-show", "Show DB instance account", func(s *mcclient.ClientSession, opts *DBInstanceAccountIdOptions) error {
account, err := modules.DBInstanceAccounts.Get(s, opts.ID, nil)
if err != nil {
return err
}
printObject(account)
return nil
})
R(&DBInstanceAccountIdOptions{}, "dbinstance-account-delete", "Delete DB instance account", func(s *mcclient.ClientSession, opts *DBInstanceAccountIdOptions) error {
account, err := modules.DBInstanceAccounts.Delete(s, opts.ID, nil)
if err != nil {
return err
}
printObject(account)
return nil
})
}

View File

@@ -15,16 +15,60 @@
package compute
import (
"yunion.io/x/onecloud/cmd/climc/shell"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func init() {
cmd := shell.NewResourceCmd(&modules.DBInstanceDatabases).WithKeyword("dbinstance-database")
cmd.List(&options.DBInstanceDatabaseListOptions{})
cmd.Update(&options.BaseUpdateOptions{})
cmd.Delete(&options.DBInstanceDatabaseIdOptions{})
cmd.Show(&options.DBInstanceDatabaseIdOptions{})
cmd.Create(&options.DBInstanceDatabaseCreateOptions{})
type DBInstanceDatabaseListOptions struct {
options.BaseListOptions
DBInstance string `help:"ID or Name of DBInstance" json:"dbinstance"`
}
R(&DBInstanceDatabaseListOptions{}, "dbinstance-database-list", "List DB instance databases", func(s *mcclient.ClientSession, opts *DBInstanceDatabaseListOptions) error {
params, err := options.ListStructToParams(opts)
if err != nil {
return err
}
result, err := modules.DBInstanceDatabases.List(s, params)
if err != nil {
return err
}
printList(result, modules.DBInstanceDatabases.GetColumns(s))
return nil
})
type DBInstanceDatabaseCreateOptions struct {
NAME string
DBINSTANCE string `help:"ID or Name of DBInstance" json:"dbinstance"`
CharacterSet string `help:"CharacterSet for database"`
}
R(&DBInstanceDatabaseCreateOptions{}, "dbinstance-database-create", "Create DB instance databases", func(s *mcclient.ClientSession, opts *DBInstanceDatabaseCreateOptions) error {
params, err := options.ListStructToParams(opts)
if err != nil {
return err
}
result, err := modules.DBInstanceDatabases.Create(s, params)
if err != nil {
return err
}
printObject(result)
return nil
})
type DBInstanceDatabaseIdOptions struct {
ID string
}
R(&DBInstanceDatabaseIdOptions{}, "dbinstance-database-delete", "Delete DB instance databases", func(s *mcclient.ClientSession, opts *DBInstanceDatabaseIdOptions) error {
result, err := modules.DBInstanceDatabases.Delete(s, opts.ID, nil)
if err != nil {
return err
}
printObject(result)
return nil
})
}

View File

@@ -15,29 +15,44 @@
package compute
import (
"yunion.io/x/onecloud/cmd/climc/shell"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func init() {
cmd := shell.NewResourceCmd(&modules.DBInstanceSkus).WithKeyword("dbinstance-sku")
cmd.List(&options.DBInstanceSkuListOption{})
cmd.Show(&options.DBInstanceSkuIdOption{})
cmd.PerformClass("sync-skus", &options.SkuSyncOptions{})
R(&options.SkuTaskQueryOptions{}, "dbinstance-sku-sync-task-show", "Show details of skus sync tasks", func(s *mcclient.ClientSession, args *options.SkuTaskQueryOptions) error {
params, err := args.Params()
type DBInstanceSkuListOption struct {
options.BaseListOptions
Engine string
EngineVersion string
Category string
StorageType string
Cloudregion string
}
R(&DBInstanceSkuListOption{}, "dbinstance-sku-list", "List dbinstance skus", func(s *mcclient.ClientSession, args *DBInstanceSkuListOption) error {
params, err := options.ListStructToParams(args)
if err != nil {
return err
}
result, err := modules.DBInstanceSkus.List(s, params)
if err != nil {
return err
}
printList(result, modules.DBInstanceSkus.GetColumns(s))
return nil
})
result, err := modules.DBInstanceSkus.Get(s, "sync-tasks", params)
type DBInstanceSkuIdOption struct {
ID string `help:"DBInstance Id or name"`
}
R(&DBInstanceSkuIdOption{}, "dbinstance-sku-show", "Show dbinstance sku details", func(s *mcclient.ClientSession, args *DBInstanceSkuIdOption) error {
result, err := modules.DBInstanceSkus.Get(s, args.ID, nil)
if err != nil {
return err
}
printObject(result)
return nil
})
}

View File

@@ -15,34 +15,280 @@
package compute
import (
"yunion.io/x/onecloud/cmd/climc/shell"
"fmt"
"strings"
"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"
"yunion.io/x/onecloud/pkg/mcclient/options/compute"
)
func init() {
cmd := shell.NewResourceCmd(&modules.DBInstance) //.WithContextManager(&modules.Networks)
cmd.List(&compute.DBInstanceListOptions{})
cmd.Create(&compute.DBInstanceCreateOptions{})
cmd.Update(&compute.DBInstanceUpdateOptions{})
cmd.Show(&compute.DBInstanceIdOptions{})
cmd.Delete(&compute.DBInstanceDeleteOptions{})
cmd.Perform("renew", &compute.DBInstanceRenewOptions{})
cmd.Perform("change-config", &compute.DBInstanceChangeConfigOptions{})
cmd.Perform("public-connection", &compute.DBInstancePublicConnectionOptions{})
cmd.Perform("recovery", &compute.DBInstanceRecoveryOptions{})
cmd.Perform("reboot", &compute.DBInstanceIdOptions{})
cmd.Perform("purge", &compute.DBInstanceIdOptions{})
cmd.Perform("syncstatus", &compute.DBInstanceIdOptions{})
cmd.Perform("sync", &compute.DBInstanceIdOptions{})
cmd.Perform("change-owner", &compute.DBInstanceChangeOwnerOptions{})
cmd.PerformWithKeyword("add-tag", "user-metadata", &options.ResourceMetadataOptions{})
cmd.PerformWithKeyword("set-tag", "set-user-metadata", &options.ResourceMetadataOptions{})
cmd.Perform("remote-update", &compute.DBInstanceRemoteUpdateOptions{})
cmd.Perform("set-secgroup", &compute.DBInstanceSetSecgroupOptions{})
type DBInstanceListOptions struct {
options.BaseListOptions
BillingType string `help:"billing type" choices:"postpaid|prepaid"`
}
R(&DBInstanceListOptions{}, "dbinstance-list", "List DB instance", func(s *mcclient.ClientSession, opts *DBInstanceListOptions) error {
params, err := options.ListStructToParams(opts)
if err != nil {
return err
}
result, err := modules.DBInstance.List(s, params)
if err != nil {
return err
}
if len(opts.ExportFile) > 0 {
exportList(result, opts.ExportFile, opts.ExportKeys, opts.ExportTexts, modules.DBInstance.GetColumns(s))
} else {
printList(result, modules.DBInstance.GetColumns(s))
}
return nil
})
type DBInstanceCreateOptions struct {
NAME string `help:"DBInstance Name"`
InstanceType string `help:"InstanceType for DBInstance"`
VcpuCount int `help:"Core of cpu for DBInstance"`
VmemSizeMb int `help:"Memory size of DBInstance"`
Port int `help:"Port of DBInstance"`
Category string `help:"Category of DBInstance"`
Network string `help:"Network of DBInstance"`
Address string `help:"Address of DBInstance"`
Engine string `help:"Engine of DBInstance"`
EngineVersion string `help:"EngineVersion of DBInstance Engine"`
StorageType string `help:"StorageTyep of DBInstance"`
Secgroup string `help:"Secgroup name or Id for DBInstance"`
Zone string `help:"ZoneId or name for DBInstance"`
DiskSizeGB int `help:"Storage size for DBInstance"`
Duration string `help:"Duration for DBInstance"`
AllowDelete *bool `help:"not lock dbinstance" `
}
R(&DBInstanceCreateOptions{}, "dbinstance-create", "Create DB instance", func(s *mcclient.ClientSession, opts *DBInstanceCreateOptions) error {
params, err := options.StructToParams(opts)
if err != nil {
return err
}
if opts.AllowDelete != nil && *opts.AllowDelete {
params.Add(jsonutils.JSONFalse, "disable_delete")
}
result, err := modules.DBInstance.Create(s, params)
if err != nil {
return err
}
printObject(result)
return nil
})
type DBInstanceRenewOptions struct {
ID string `help:"ID or name of server to renew"`
DURATION string `help:"Duration of renew, ADMIN only command"`
}
R(&DBInstanceRenewOptions{}, "dbinstance-renew", "Renew a dbinstance", func(s *mcclient.ClientSession, args *DBInstanceRenewOptions) error {
params := jsonutils.NewDict()
params.Add(jsonutils.NewString(args.DURATION), "duration")
result, err := modules.DBInstance.PerformAction(s, args.ID, "renew", params)
if err != nil {
return err
}
printObject(result)
return nil
})
type DBInstanceUpdateOptions struct {
ID string `help:"ID or name of server to renew"`
Name string
Description string
Delete string `help:"Lock or not lock dbinstance" choices:"enable|disable"`
}
R(&DBInstanceUpdateOptions{}, "dbinstance-update", "Update a dbinstance", func(s *mcclient.ClientSession, args *DBInstanceUpdateOptions) error {
params, err := options.StructToParams(args)
if err != nil {
return err
}
if len(args.Delete) > 0 {
if args.Delete == "disable" {
params.Add(jsonutils.JSONTrue, "disable_delete")
} else {
params.Add(jsonutils.JSONFalse, "disable_delete")
}
}
result, err := modules.DBInstance.Update(s, args.ID, params)
if err != nil {
return err
}
printObject(result)
return nil
})
type DBInstanceChangeConfigOptions struct {
ID string `help:"ID or name of server to renew"`
DiskSizeGb int64 `help:"Change DBInstance storage size"`
VcpuCount int64 `help:"Change DBInstance vcpu count"`
VmemSizeMb int64 `help:"Change DBInstance vmem size mb"`
InstanceType string `help:"Change DBInstance instanceType"`
Category string `help:"Change DBInstance category"`
}
R(&DBInstanceChangeConfigOptions{}, "dbinstance-change-config", "ChangeConfig a dbinstance", func(s *mcclient.ClientSession, args *DBInstanceChangeConfigOptions) error {
params := jsonutils.NewDict()
if len(args.Category) > 0 {
params.Add(jsonutils.NewString(args.Category), "category")
}
if len(args.InstanceType) > 0 {
params.Add(jsonutils.NewString(args.InstanceType), "instance_type")
}
if args.DiskSizeGb > 0 {
params.Add(jsonutils.NewInt(args.DiskSizeGb), "disk_size_gb")
}
if args.VcpuCount > 0 {
params.Add(jsonutils.NewInt(args.VcpuCount), "vcpu_count")
}
if args.VmemSizeMb > 0 {
params.Add(jsonutils.NewInt(args.VmemSizeMb), "vmeme_size_mb")
}
result, err := modules.DBInstance.PerformAction(s, args.ID, "change-config", params)
if err != nil {
return err
}
printObject(result)
return nil
})
type DBInstanceIdOptions struct {
ID string `help:"ID of dbinstance"`
}
R(&DBInstanceIdOptions{}, "dbinstance-open-public-connection", "Open DB instance public connection", func(s *mcclient.ClientSession, opts *DBInstanceIdOptions) error {
params := jsonutils.NewDict()
params.Add(jsonutils.JSONTrue, "open")
result, err := modules.DBInstance.PerformAction(s, opts.ID, "public-connection", params)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&DBInstanceIdOptions{}, "dbinstance-close-public-connection", "Close DB instance public connection", func(s *mcclient.ClientSession, opts *DBInstanceIdOptions) error {
params := jsonutils.NewDict()
params.Add(jsonutils.JSONFalse, "open")
result, err := modules.DBInstance.PerformAction(s, opts.ID, "public-connection", params)
if err != nil {
return err
}
printObject(result)
return nil
})
type DBInstanceRecoveryOptions struct {
ID string
BACKUP string
Databases []string
}
R(&DBInstanceRecoveryOptions{}, "dbinstance-recovery", "Recovery DB instance database from backup", func(s *mcclient.ClientSession, opts *DBInstanceRecoveryOptions) error {
params := jsonutils.NewDict()
params.Set("dbinstancebackup", jsonutils.NewString(opts.BACKUP))
dbs := jsonutils.NewDict()
for _, database := range opts.Databases {
if len(database) > 0 {
dbInfo := strings.Split(database, ":")
if len(dbInfo) == 1 {
dbs.Add(jsonutils.NewString(dbInfo[0]), dbInfo[0])
} else if len(dbInfo) == 2 {
dbs.Add(jsonutils.NewString(dbInfo[1]), dbInfo[0])
} else {
return fmt.Errorf("Invalid dbinfo: %s", database)
}
}
}
if dbs.Length() > 0 {
params.Add(dbs, "databases")
}
result, err := modules.DBInstance.PerformAction(s, opts.ID, "recovery", params)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&DBInstanceIdOptions{}, "dbinstance-show", "Show DB instance", func(s *mcclient.ClientSession, opts *DBInstanceIdOptions) error {
result, err := modules.DBInstance.Get(s, opts.ID, nil)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&DBInstanceIdOptions{}, "dbinstance-reboot", "Reboot DB instance", func(s *mcclient.ClientSession, opts *DBInstanceIdOptions) error {
result, err := modules.DBInstance.PerformAction(s, opts.ID, "reboot", nil)
if err != nil {
return err
}
printObject(result)
return nil
})
type DBInstanceDeleteOptions struct {
ID string `help:"DBInstance Id or name"`
KeepBackup bool `help:"Keep dbinstance manual backup after delete dbinstance"`
}
R(&DBInstanceDeleteOptions{}, "dbinstance-delete", "Delete DB instance", func(s *mcclient.ClientSession, opts *DBInstanceDeleteOptions) error {
params := jsonutils.NewDict()
if opts.KeepBackup {
params.Add(jsonutils.JSONTrue, "keep_backup")
}
result, err := modules.DBInstance.Delete(s, opts.ID, params)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&DBInstanceIdOptions{}, "dbinstance-purge", "Purge DB instance", func(s *mcclient.ClientSession, opts *DBInstanceIdOptions) error {
result, err := modules.DBInstance.PerformAction(s, opts.ID, "purge", nil)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&DBInstanceIdOptions{}, "dbinstance-syncstatus", "Sync status for DB instance", func(s *mcclient.ClientSession, opts *DBInstanceIdOptions) error {
result, err := modules.DBInstance.PerformAction(s, opts.ID, "syncstatus", nil)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&DBInstanceIdOptions{}, "dbinstance-sync", "Sync conf from cloud dbinstance", func(s *mcclient.ClientSession, opts *DBInstanceIdOptions) error {
result, err := modules.DBInstance.PerformAction(s, opts.ID, "sync", nil)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&DBInstanceIdOptions{}, "dbinstance-sync-status", "Sync status for DB instance", func(s *mcclient.ClientSession, opts *DBInstanceIdOptions) error {
result, err := modules.DBInstance.PerformAction(s, opts.ID, "sync-status", nil)
if err != nil {
return err
}
printObject(result)
return nil
})
type DBInstanceNetworkListOptions struct {
options.BaseListOptions
@@ -108,4 +354,21 @@ func init() {
return nil
})
type DBInstanceChangeOwnerOptions struct {
ID string `help:"DBInstance to change owner" json:"-"`
PROJECT string `help:"Project ID or change" json:"tenant"`
}
R(&DBInstanceChangeOwnerOptions{}, "dbinstance-change-owner", "Change owner porject of a dbinstance", func(s *mcclient.ClientSession, opts *DBInstanceChangeOwnerOptions) error {
params, err := options.StructToParams(opts)
if err != nil {
return err
}
result, err := modules.DBInstance.PerformAction(s, opts.ID, "change-owner", params)
if err != nil {
return err
}
printObject(result)
return nil
})
}

View File

@@ -149,7 +149,6 @@ func init() {
AutoDelete string `help:"enable/disable auto delete of disk" choices:"enable|disable"`
AutoSnapshot string `help:"enable/disable auto snapshot of disk" choices:"enable|disable"`
DiskType string `help:"Disk type" choices:"data|volume"`
IsSsd *bool `help:"mark disk as ssd" negative:"no-is-ssd"`
}
R(&DiskUpdateOptions{}, "disk-update", "Update property of a virtual disk", func(s *mcclient.ClientSession, args *DiskUpdateOptions) error {
params := jsonutils.NewDict()
@@ -176,13 +175,6 @@ func init() {
if len(args.DiskType) > 0 {
params.Add(jsonutils.NewString(args.DiskType), "disk_type")
}
if args.IsSsd != nil {
if *args.IsSsd {
params.Add(jsonutils.JSONTrue, "is_ssd")
} else {
params.Add(jsonutils.JSONFalse, "is_ssd")
}
}
if params.Size() == 0 {
return InvalidUpdateError()
}

View File

@@ -19,16 +19,12 @@ import (
"yunion.io/x/jsonutils"
"yunion.io/x/onecloud/cmd/climc/shell"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func init() {
cmd := shell.NewResourceCmd(&modules.ElasticcacheSkus).WithKeyword("elastic-cache-sku")
cmd.PerformClass("sync-skus", &options.SkuSyncOptions{})
R(&options.BaseListOptions{}, "elastic-cache-list", "List elastisc cache instance", func(s *mcclient.ClientSession, opts *options.BaseListOptions) error {
params, err := options.ListStructToParams(opts)
if err != nil {
@@ -45,15 +41,11 @@ func init() {
})
R(&options.ElasticCacheCreateOptions{}, "elastic-cache-create", "Create elastisc cache instance", func(s *mcclient.ClientSession, opts *options.ElasticCacheCreateOptions) error {
params, err := opts.Params()
params, err := options.StructToParams(opts)
if err != nil {
return err
}
if len(opts.SecgroupIds) > 0 {
params.Set("secgroup_ids", jsonutils.NewStringArray(opts.SecgroupIds))
}
result, err := modules.ElasticCache.Create(s, params)
if err != nil {
return err
@@ -401,107 +393,4 @@ func init() {
printList(result, nil)
return nil
})
R(&options.SkuTaskQueryOptions{}, "elastic-cache-sku-sync-task-show", "Show details of skus sync tasks", func(s *mcclient.ClientSession, args *options.SkuTaskQueryOptions) error {
params, err := args.Params()
if err != nil {
return err
}
result, err := modules.ElasticcacheSkus.Get(s, "sync-tasks", params)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&options.ResourceMetadataOptions{}, "elastic-cache-add-tag", "Set tag of a server", func(s *mcclient.ClientSession, opts *options.ResourceMetadataOptions) error {
params, err := opts.Params()
if err != nil {
return err
}
result, err := modules.ElasticCache.PerformAction(s, opts.ID, "user-metadata", params)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&options.ResourceMetadataOptions{}, "elastic-cache-set-tag", "Set tag of a server", func(s *mcclient.ClientSession, opts *options.ResourceMetadataOptions) error {
params, err := opts.Params()
if err != nil {
return err
}
result, err := modules.ElasticCache.PerformAction(s, opts.ID, "set-user-metadata", params)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&options.ElasticCacheRemoteUpdateOptions{}, "elastic-cache-remote-update", "Restore elastisc cache backup", func(s *mcclient.ClientSession, opts *options.ElasticCacheRemoteUpdateOptions) error {
params, err := options.StructToParams(opts)
if err != nil {
return err
}
result, err := modules.ElasticCache.PerformAction(s, opts.ID, "remote-update", params)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&options.ElasticCacheAutoRenewOptions{}, "elastic-cache-auto-renew", "Set elastisc cache auto renew", func(s *mcclient.ClientSession, opts *options.ElasticCacheAutoRenewOptions) error {
params, err := options.StructToParams(opts)
if err != nil {
return err
}
result, err := modules.ElasticCache.PerformAction(s, opts.ID, "set-auto-renew", params)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&options.ElasticCacheRenewOptions{}, "elastic-cache-renew", "Renew elastisc cache", func(s *mcclient.ClientSession, opts *options.ElasticCacheRenewOptions) error {
params, err := options.StructToParams(opts)
if err != nil {
return err
}
result, err := modules.ElasticCache.PerformAction(s, opts.ID, "renew", params)
if err != nil {
return err
}
printObject(result)
return nil
})
type ElasticcacheSecgroupListOptions struct {
options.BaseListOptions
Elasticcache string `help:"ID or Name of elastic cache" json:"elasticcache"`
Secgroup string `help:"Secgroup ID or name"`
}
R(&ElasticcacheSecgroupListOptions{}, "elastic-cache-secgroup-list", "List elastisc cache secgroups", func(s *mcclient.ClientSession, opts *ElasticcacheSecgroupListOptions) error {
params, err := options.ListStructToParams(opts)
if err != nil {
return err
}
result, err := modules.ElasticCacheSecgroup.List(s, params)
if err != nil {
return err
}
printList(result, nil)
return nil
})
}

View File

@@ -50,9 +50,8 @@ func init() {
Manager string `help:"cloud provider"`
Region string `help:"cloud region in which EIP is allocated"`
Bandwidth int `help:"Bandwidth in Mbps"`
IpAddr string `help:"IP address of the EIP" json:"ip_addr"`
Ip string `help:"IP address of the EIP"`
Network string `help:"Network of the EIP"`
BgpType string `help:"BgpType of the EIP" positional:"false"`
ChargeType string `help:"bandwidth charge type" choices:"traffic|bandwidth"`
}
R(&EipCreateOptions{}, "eip-create", "Create an EIP", func(s *mcclient.ClientSession, args *EipCreateOptions) error {
@@ -75,12 +74,9 @@ func init() {
if len(args.Network) > 0 {
params.Add(jsonutils.NewString(args.Network), "network")
}
if len(args.BgpType) > 0 {
params.Add(jsonutils.NewString(args.BgpType), "bgp_type")
}
if len(args.IpAddr) > 0 {
params.Add(jsonutils.NewString(args.IpAddr), "ip_addr")
if len(args.Ip) > 0 {
params.Add(jsonutils.NewString(args.Ip), "ip")
}
result, err := modules.Elasticips.Create(s, params)
@@ -190,16 +186,12 @@ func init() {
type ServerCreateEipOptions struct {
ID string `help:"server ID or name"`
BW int `help:"EIP bandwidth in Mbps"`
BgpType string `help:"desired BGP type"`
ChargeType string `help:"bandwidth charge type" choices:"traffic|bandwidth"`
}
R(&ServerCreateEipOptions{}, "server-create-eip", "allocate an EIP and associate EIP to server", func(s *mcclient.ClientSession, args *ServerCreateEipOptions) error {
params := jsonutils.NewDict()
params.Add(jsonutils.NewInt(int64(args.BW)), "bandwidth")
if args.BgpType != "" {
params.Add(jsonutils.NewString(args.BgpType), "bgp_type")
}
if len(args.ChargeType) > 0 {
params.Add(jsonutils.NewString(args.ChargeType), "charge_type")
}

View File

@@ -407,14 +407,12 @@ func init() {
})
type HostAddNetIfOptions struct {
ID string `help:"ID or Name of host"`
WIRE string `help:"ID or Name of wire to attach"`
MAC string `help:"Mac address of NIC"`
INDEX int64 `help:"nic index"`
Type string `help:"Nic type" choices:"admin|ipmi"`
IpAddr string `help:"IP address"`
Bridge string `help:"Bridge of hostwire"`
Interface string `help:"Interface name, eg:eth0, en0"`
ID string `help:"ID or Name of host"`
WIRE string `help:"ID or Name of wire to attach"`
MAC string `help:"Mac address of NIC"`
INDEX int64 `help:"nic index"`
Type string `help:"Nic type" choices:"admin|ipmi"`
IpAddr string `help:"IP address"`
}
R(&HostAddNetIfOptions{}, "host-add-netif", "Host add a NIC", func(s *mcclient.ClientSession, args *HostAddNetIfOptions) error {
params := jsonutils.NewDict()
@@ -428,12 +426,6 @@ func init() {
if len(args.IpAddr) > 0 {
params.Add(jsonutils.NewString(args.IpAddr), "ip_addr")
}
if len(args.Bridge) > 0 {
params.Add(jsonutils.NewString(args.Bridge), "bridge")
}
if len(args.Interface) > 0 {
params.Add(jsonutils.NewString(args.Interface), "interface")
}
result, err := modules.Hosts.PerformAction(s, args.ID, "add-netif", params)
if err != nil {
return err

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 compute
import (
"yunion.io/x/onecloud/cmd/climc/shell"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func init() {
cmd := shell.NewResourceCmd(&modules.InterVpcNetworks).WithKeyword("inter-vpc-network")
cmd.List(&options.InterVpcNetworkListOPtions{})
cmd.Show(&options.InterVpcNetworkIdOPtions{})
cmd.Create(&options.InterVpcNetworkCreateOPtions{})
cmd.Delete(&options.InterVpcNetworkIdOPtions{})
cmd.Perform("syncstatus", &options.InterVpcNetworkIdOPtions{})
cmd.Perform("addvpc", &options.InterVpcNetworkAddVpcOPtions{})
cmd.Perform("removevpc", &options.InterVpcNetworkRemoveVpcOPtions{})
}

View File

@@ -1,29 +0,0 @@
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package compute
import (
"yunion.io/x/onecloud/cmd/climc/shell"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func init() {
cmd := shell.NewResourceCmd(&modules.InterVpcNetworkRouteSets).WithKeyword("inter-vpc-network-routeset")
cmd.List(&options.InterVpcNetworkRouteListOptions{})
cmd.Show(&options.InterVpcNetworkRouteIdptions{})
cmd.Perform("enable", &options.InterVpcNetworkRouteIdptions{})
cmd.Perform("disable", &options.InterVpcNetworkRouteIdptions{})
}

View File

@@ -137,21 +137,4 @@ func init() {
printLbAcl(lbacl)
return nil
})
R(&options.LoadbalancerAclPublicOptions{}, "lbacl-public", "Public lbacl", func(s *mcclient.ClientSession, opts *options.LoadbalancerAclPublicOptions) error {
params := jsonutils.Marshal(opts)
lbacl, err := modules.LoadbalancerAcls.PerformAction(s, opts.ID, "public", params)
if err != nil {
return err
}
printLbAcl(lbacl)
return nil
})
R(&options.LoadbalancerAclPrivateOptions{}, "lbacl-private", "Private lbacl", func(s *mcclient.ClientSession, opts *options.LoadbalancerAclPrivateOptions) error {
lbacl, err := modules.LoadbalancerAcls.PerformAction(s, opts.ID, "private", nil)
if err != nil {
return err
}
printLbAcl(lbacl)
return nil
})
}

View File

@@ -15,8 +15,6 @@
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"
@@ -83,21 +81,4 @@ func init() {
printObject(lbcert)
return nil
})
R(&options.LoadbalancerCertificatePublicOptions{}, "lbcert-public", "Public lbcert", func(s *mcclient.ClientSession, opts *options.LoadbalancerCertificatePublicOptions) error {
params := jsonutils.Marshal(opts)
lbcert, err := modules.LoadbalancerCertificates.PerformAction(s, opts.ID, "public", params)
if err != nil {
return err
}
printObject(lbcert)
return nil
})
R(&options.LoadbalancerCertificatePrivateOptions{}, "lbcert-private", "Private lbcert", func(s *mcclient.ClientSession, opts *options.LoadbalancerCertificatePrivateOptions) error {
lbcert, err := modules.LoadbalancerCertificates.PerformAction(s, opts.ID, "private", nil)
if err != nil {
return err
}
printObject(lbcert)
return nil
})
}

View File

@@ -15,44 +15,92 @@
package compute
import (
"yunion.io/x/onecloud/cmd/climc/shell"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func init() {
cmd := shell.NewResourceCmd(&modules.Loadbalancers).WithKeyword("lb")
cmd.Create(&options.LoadbalancerCreateOptions{})
cmd.Show(&options.LoadbalancerIdOptions{})
cmd.List(&options.LoadbalancerListOptions{})
cmd.Update(&options.LoadbalancerUpdateOptions{})
cmd.Delete(&options.LoadbalancerIdOptions{})
cmd.Perform("purge", &options.LoadbalancerIdOptions{})
cmd.Perform("status", &options.LoadbalancerActionStatusOptions{})
cmd.Perform("syncstatus", &options.LoadbalancerIdOptions{})
cmd.Perform("remote-update", &options.LoadbalancerRemoteUpdateOptions{})
cmd.Get("change-owner-candidate-domains", &options.LoadbalancerIdOptions{})
R(&options.ResourceMetadataOptions{}, "lb-add-tag", "Set tag of a lb", func(s *mcclient.ClientSession, opts *options.ResourceMetadataOptions) error {
params, err := opts.Params()
R(&options.LoadbalancerCreateOptions{}, "lb-create", "Create lb", func(s *mcclient.ClientSession, opts *options.LoadbalancerCreateOptions) error {
params, err := options.StructToParams(opts)
if err != nil {
return err
}
result, err := modules.Loadbalancers.PerformAction(s, opts.ID, "user-metadata", params)
lb, err := modules.Loadbalancers.Create(s, params)
if err != nil {
return err
}
printObject(result)
printObject(lb)
return nil
})
R(&options.LoadbalancerGetOptions{}, "lb-show", "Show lb", func(s *mcclient.ClientSession, opts *options.LoadbalancerGetOptions) error {
lb, err := modules.Loadbalancers.Get(s, opts.ID, nil)
if err != nil {
return err
}
printObject(lb)
return nil
})
R(&options.LoadbalancerListOptions{}, "lb-list", "List lbs", func(s *mcclient.ClientSession, opts *options.LoadbalancerListOptions) error {
params, err := options.ListStructToParams(opts)
if err != nil {
return err
}
result, err := modules.Loadbalancers.List(s, params)
if err != nil {
return err
}
printList(result, modules.Loadbalancers.GetColumns(s))
return nil
})
R(&options.LoadbalancerUpdateOptions{}, "lb-update", "Update lb", func(s *mcclient.ClientSession, opts *options.LoadbalancerUpdateOptions) error {
params, err := options.StructToParams(opts)
lb, err := modules.Loadbalancers.Update(s, opts.ID, params)
if err != nil {
return err
}
printObject(lb)
return nil
})
R(&options.LoadbalancerDeleteOptions{}, "lb-delete", "Delete lb", func(s *mcclient.ClientSession, opts *options.LoadbalancerDeleteOptions) error {
lb, err := modules.Loadbalancers.Delete(s, opts.ID, nil)
if err != nil {
return err
}
printObject(lb)
return nil
})
R(&options.LoadbalancerPurgeOptions{}, "lb-purge", "Purge lb", func(s *mcclient.ClientSession, opts *options.LoadbalancerPurgeOptions) error {
lb, err := modules.Loadbalancers.PerformAction(s, opts.ID, "purge", nil)
if err != nil {
return err
}
printObject(lb)
return nil
})
R(&options.LoadbalancerActionStatusOptions{}, "lb-status", "Change lb status", func(s *mcclient.ClientSession, opts *options.LoadbalancerActionStatusOptions) error {
params, err := options.StructToParams(opts)
if err != nil {
return err
}
lb, err := modules.Loadbalancers.PerformAction(s, opts.ID, "status", params)
if err != nil {
return err
}
printObject(lb)
return nil
})
R(&options.LoadbalancerActionSyncStatusOptions{}, "lb-syncstatus", "Sync lb status", func(s *mcclient.ClientSession, opts *options.LoadbalancerActionSyncStatusOptions) error {
lb, err := modules.Loadbalancers.PerformAction(s, opts.ID, "syncstatus", nil)
if err != nil {
return err
}
printObject(lb)
return nil
})
R(&options.ResourceMetadataOptions{}, "lb-set-tag", "Set tag of a lb", func(s *mcclient.ClientSession, opts *options.ResourceMetadataOptions) error {
params, err := opts.Params()
if err != nil {
return err
}
result, err := modules.Loadbalancers.PerformAction(s, opts.ID, "set-user-metadata", params)
R(&options.LoadbalancerGetOptions{}, "lb-change-owner-candidate-domains", "Get change owner candidate domain list", func(s *mcclient.ClientSession, args *options.LoadbalancerGetOptions) error {
result, err := modules.Loadbalancers.GetSpecific(s, args.ID, "change-owner-candidate-domains", nil)
if err != nil {
return err
}

View File

@@ -1,29 +0,0 @@
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package compute
import (
"yunion.io/x/onecloud/cmd/climc/shell"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func init() {
cmd := shell.NewResourceCmd(&modules.NetworkAddresses).WithContextManager(&modules.Wires)
cmd.BatchCreate(&options.NetworkAddressCreateOptions{})
cmd.List(&options.NetworkAddressListOptions{})
cmd.Show(&options.NetworkAddressIdOptions{})
cmd.Delete(&options.NetworkAddressIdOptions{})
}

View File

@@ -69,7 +69,6 @@ func init() {
AllocPolicy string `help:"Address allocation policy" choices:"none|stepdown|stepup|random"`
ServerType string `help:"Server type" choices:"baremetal|container|eip|guest|ipmi|pxe"`
IsAutoAlloc *bool `help:"Auto allocation IP pool"`
BgpType string `help:"Internet service provider name" positional:"false"`
Desc string `help:"Description" metavar:"DESCRIPTION"`
}
R(&NetworkCreateOptions{}, "network-create", "Create a virtual network", func(s *mcclient.ClientSession, args *NetworkCreateOptions) error {
@@ -96,9 +95,6 @@ func init() {
if len(args.Desc) > 0 {
params.Add(jsonutils.NewString(args.Desc), "description")
}
if len(args.BgpType) > 0 {
params.Add(jsonutils.NewString(args.BgpType), "bgp_type")
}
if args.IsAutoAlloc != nil {
params.Add(jsonutils.NewBool(*args.IsAutoAlloc), "is_auto_alloc")
}
@@ -111,21 +107,17 @@ func init() {
})
type NetworkCreateOptions2 struct {
Wire string `help:"ID or Name of wire in which the network is created"`
Vpc string `help:"ID or Name of vpc in which the network is created"`
Zone string `help:"ID or Name of zone in which the network is created"`
NAME string `help:"Name of new network"`
PREFIX string `help:"Start of IPv4 address range"`
BgpType string `help:"Internet service provider name" positional:"false"`
Desc string `help:"Description" metavar:"DESCRIPTION"`
Wire string `help:"ID or Name of wire in which the network is created"`
Vpc string `help:"ID or Name of vpc in which the network is created"`
Zone string `help:"ID or Name of zone in which the network is created"`
NAME string `help:"Name of new network"`
PREFIX string `help:"Start of IPv4 address range"`
Desc string `help:"Description" metavar:"DESCRIPTION"`
}
R(&NetworkCreateOptions2{}, "network-create2", "Create a virtual network", func(s *mcclient.ClientSession, args *NetworkCreateOptions2) error {
params := jsonutils.NewDict()
params.Add(jsonutils.NewString(args.NAME), "name")
params.Add(jsonutils.NewString(args.PREFIX), "guest_ip_prefix")
if len(args.BgpType) > 0 {
params.Add(jsonutils.NewString(args.BgpType), "bgp_type")
}
if len(args.Desc) > 0 {
params.Add(jsonutils.NewString(args.Desc), "description")
}
@@ -261,20 +253,4 @@ func init() {
printObject(net)
return nil
})
type NetworkSetBgpTypeOptions struct {
ID string `help:"Network to set BgpType" json:"-"`
BgpType *string `help:"new BgpType name"`
}
R(&NetworkSetBgpTypeOptions{}, "network-set-bgp-type", "Set BgpType of a network", func(s *mcclient.ClientSession, args *NetworkSetBgpTypeOptions) error {
params, err := options.StructToParams(args)
if err != nil {
return err
}
net, err := modules.Networks.PerformAction(s, args.ID, "set-bgp-type", params)
if err != nil {
return err
}
printObject(net)
return nil
})
}

View File

@@ -58,8 +58,7 @@ type RegionQuotaOptions struct {
Eip int64 `help:"Elastic IP count" json:"eip,omitzero"`
Snapshot int64 `help:"Snapshot count" json:"snapshot,omitzero"`
InstanceSnapshot int64 `help:"Instance snapshot count" json:"instance_snapshot,omitzero"`
Snapshot int64 `help:"Snapshot count" json:"snapshot,omitzero"`
Bucket int64 `help:"bucket count" json:"bucket,omitzero"`
ObjectGB int64 `help:"object size in GB" json:"object_gb,omitzero"`
@@ -317,7 +316,7 @@ func init() {
QuotaSetBaseOptions
IdentityQuotaOptions
}
R(&IdentityQuotaSetOptions{}, "identity-quota-set", "Set identity quota for domain", func(s *mcclient.ClientSession, args *IdentityQuotaSetOptions) error {
R(&IdentityQuotaSetOptions{}, "identity-quota-set", "Set identity quota for domain", func(s *mcclient.ClientSession, args *InfrasQuotaSetOptions) error {
params := jsonutils.Marshal(args)
quotas, e := modules.IdentityQuotas.DoQuotaSet(s, params)
if e != nil {

View File

@@ -1,27 +0,0 @@
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package compute
import (
"yunion.io/x/onecloud/cmd/climc/shell"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func init() {
cmd := shell.NewResourceCmd(&modules.RouteTableRouteAssociations).WithKeyword("routetable-association")
cmd.List(&options.RouteTableAssociationListOptions{})
cmd.Show(&options.RouteTableAssociationIdOptions{})
}

View File

@@ -1,30 +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/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func init() {
cmd := shell.NewResourceCmd(&modules.RouteTableRouteSets).WithKeyword("routetable-routeset")
cmd.List(&options.RouteTableRouteSetListOptions{})
cmd.Show(&options.RouteTableRouteSetIdOptions{})
cmd.Create(&options.RouteTableRouteSetCreateOptions{})
cmd.Update(&options.RouteTableRouteSetUpdateOptions{})
cmd.Delete(&options.RouteTableRouteSetIdOptions{})
}

View File

@@ -15,20 +15,126 @@
package compute
import (
"yunion.io/x/onecloud/cmd/climc/shell"
"fmt"
"strings"
"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() {
cmd := shell.NewResourceCmd(&modules.RouteTables).WithKeyword("routetable")
cmd.List(&options.RouteTableListOptions{})
cmd.Show(&options.RouteTableIdOptions{})
cmd.Create(&options.RouteTableCreateOptions{})
cmd.Update(&options.RouteTableUpdateOptions{})
cmd.Delete(&options.RouteTableIdOptions{})
cmd.Perform("syncstatus", &options.RouteTableIdOptions{})
cmd.Perform("add-routes", &options.RouteTableAddRoutesOptions{})
cmd.Perform("del-routes", &options.RouteTableDelRoutesOptions{})
cmd.Perform("purge", &options.RouteTableIdOptions{})
printRouteTableList := func(list *modulebase.ListResult, columns []string) {
data := list.Data
for _, jsonObj := range data {
jd := jsonObj.(*jsonutils.JSONDict)
routesObj, err := jd.GetArray("routes")
if err != nil {
continue
}
routes := []string{}
for _, routeObj := range routesObj {
typ, _ := routeObj.GetString("type")
cidr, _ := routeObj.GetString("cidr")
next_hop_type, _ := routeObj.GetString("next_hop_type")
next_hop_id, _ := routeObj.GetString("next_hop_id")
route := fmt.Sprintf("%8s: %18s %s", typ, cidr, next_hop_type)
if next_hop_id != "" {
route += fmt.Sprintf(":%s", next_hop_id)
}
routes = append(routes, route)
}
s := strings.Join(routes, "\n")
jd.Set("routes", jsonutils.NewString(s))
}
printList(list, columns)
}
R(&options.RouteTableCreateOptions{}, "routetable-create", "Create routetable", func(s *mcclient.ClientSession, opts *options.RouteTableCreateOptions) error {
params, err := opts.Params()
if err != nil {
return err
}
routetable, err := modules.RouteTables.Create(s, params)
if err != nil {
return err
}
printObjectRecursive(routetable)
return nil
})
R(&options.RouteTableGetOptions{}, "routetable-show", "Show routetable", func(s *mcclient.ClientSession, opts *options.RouteTableGetOptions) error {
routetable, err := modules.RouteTables.Get(s, opts.ID, nil)
if err != nil {
return err
}
printObjectRecursive(routetable)
return nil
})
R(&options.RouteTableListOptions{}, "routetable-list", "List routetables", func(s *mcclient.ClientSession, opts *options.RouteTableListOptions) error {
params, err := options.ListStructToParams(opts)
if err != nil {
return err
}
result, err := modules.RouteTables.List(s, params)
if err != nil {
return err
}
printRouteTableList(result, modules.RouteTables.GetColumns(s))
return nil
})
R(&options.RouteTableUpdateOptions{}, "routetable-update", "Update routetable", func(s *mcclient.ClientSession, opts *options.RouteTableUpdateOptions) error {
params, err := opts.Params()
if err != nil {
return err
}
routetable, err := modules.RouteTables.Update(s, opts.ID, params)
if err != nil {
return err
}
printObjectRecursive(routetable)
return nil
})
R(&options.RouteTableAddRoutesOptions{}, "routetable-add-routes", "Add routes to routetable", func(s *mcclient.ClientSession, opts *options.RouteTableAddRoutesOptions) error {
params, err := opts.Params()
if err != nil {
return err
}
routetable, err := modules.RouteTables.PerformAction(s, opts.ID, "add-routes", params)
if err != nil {
return err
}
printObjectRecursive(routetable)
return nil
})
R(&options.RouteTableDelRoutesOptions{}, "routetable-del-routes", "Del routes to routetable", func(s *mcclient.ClientSession, opts *options.RouteTableDelRoutesOptions) error {
params, err := opts.Params()
if err != nil {
return err
}
routetable, err := modules.RouteTables.PerformAction(s, opts.ID, "del-routes", params)
if err != nil {
return err
}
printObjectRecursive(routetable)
return nil
})
R(&options.RouteTableDeleteOptions{}, "routetable-delete", "Delete routetable", func(s *mcclient.ClientSession, opts *options.RouteTableDeleteOptions) error {
routetable, err := modules.RouteTables.Delete(s, opts.ID, nil)
if err != nil {
return err
}
printObjectRecursive(routetable)
return nil
})
R(&options.RouteTablePurgeOptions{}, "routetable-purge", "Purge routetable", func(s *mcclient.ClientSession, opts *options.RouteTablePurgeOptions) error {
routetable, err := modules.RouteTables.PerformAction(s, opts.ID, "purge", nil)
if err != nil {
return err
}
printObjectRecursive(routetable)
return nil
})
}

View File

@@ -123,8 +123,5 @@ func init() {
modules.Schedtaghosts,
modules.Schedtagstorages,
modules.Schedtagnetworks,
modules.Schedtagcloudproviders,
modules.Schedtagcloudregions,
modules.Schedtagzones,
).register()
}

View File

@@ -15,20 +15,142 @@
package compute
import (
"yunion.io/x/onecloud/cmd/climc/shell"
"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() {
cmd := shell.NewResourceCmd(&modules.Schedtags)
type SchedtagListOptions struct {
options.BaseListOptions
Type string `help:"Filter by resource type"`
}
R(&SchedtagListOptions{}, "schedtag-list", "List schedule tags", func(s *mcclient.ClientSession, args *SchedtagListOptions) error {
var params *jsonutils.JSONDict
{
var err error
params, err = args.BaseListOptions.Params()
if err != nil {
return err
cmd.List(new(options.SchedtagListOptions))
cmd.Show(new(options.SchedtagShowOptions))
cmd.Delete(new(options.SchedtagShowOptions))
cmd.Create(new(options.SchedtagCreateOptions))
cmd.Update(new(options.SchedtagUpdateOptions))
cmd.BatchPerform("set-scope", new(options.SchedtagSetScopeOptions))
cmd.PerformWithKeyword("set-user-metadata", "user-metadata", new(options.ResourceMetadataOptions))
cmd.Perform("set-resource", new(options.SchedtagSetResource))
}
}
if len(args.Type) > 0 {
params.Add(jsonutils.NewString(args.Type), "resource_type")
}
result, err := modules.Schedtags.List(s, params)
if err != nil {
return err
}
printList(result, modules.Schedtags.GetColumns(s))
return nil
})
type SchedtagShowOptions struct {
ID string `help:"ID or Name of the scheduler tag to show"`
}
R(&SchedtagShowOptions{}, "schedtag-show", "Show scheduler tag details", func(s *mcclient.ClientSession, args *SchedtagShowOptions) error {
result, err := modules.Schedtags.Get(s, args.ID, nil)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&SchedtagShowOptions{}, "schedtag-delete", "Delete a scheduler tag", func(s *mcclient.ClientSession, args *SchedtagShowOptions) error {
result, err := modules.Schedtags.Delete(s, args.ID, nil)
if err != nil {
return err
}
printObject(result)
return nil
})
type SchedtagCreateOptions struct {
NAME string `help:"Name of new schedtag"`
Strategy string `help:"Policy" choices:"require|exclude|prefer|avoid"`
Desc string `help:"Description"`
Scope string `help:"Resource scope" choices:"system|domain|project"`
Type string `help:"Resource type" choices:"hosts|storages|networks"`
}
R(&SchedtagCreateOptions{}, "schedtag-create", "Create a schedule tag", func(s *mcclient.ClientSession, args *SchedtagCreateOptions) error {
params := jsonutils.NewDict()
params.Add(jsonutils.NewString(args.NAME), "name")
if len(args.Strategy) > 0 {
params.Add(jsonutils.NewString(args.Strategy), "default_strategy")
}
if len(args.Desc) > 0 {
params.Add(jsonutils.NewString(args.Desc), "description")
}
if len(args.Type) > 0 {
params.Add(jsonutils.NewString(args.Type), "resource_type")
}
if len(args.Scope) > 0 {
params.Add(jsonutils.NewString(args.Scope), "scope")
}
schedtag, err := modules.Schedtags.Create(s, params)
if err != nil {
return err
}
printObject(schedtag)
return nil
})
type SchedtagUpdateOptions struct {
ID string `help:"ID or Name of schetag"`
Name string `help:"New name of schedtag"`
Strategy string `help:"Policy" choices:"require|exclude|prefer|avoid"`
Desc string `help:"Description"`
ClearStrategy bool `help:"Clear default schedule policy"`
}
R(&SchedtagUpdateOptions{}, "schedtag-update", "Update a schedule tag", func(s *mcclient.ClientSession, args *SchedtagUpdateOptions) error {
params := jsonutils.NewDict()
if len(args.Name) > 0 {
params.Add(jsonutils.NewString(args.Name), "name")
}
if len(args.Strategy) > 0 {
params.Add(jsonutils.NewString(args.Strategy), "default_strategy")
}
if len(args.Desc) > 0 {
params.Add(jsonutils.NewString(args.Desc), "description")
}
if args.ClearStrategy {
params.Add(jsonutils.NewString(""), "default_strategy")
}
if params.Size() == 0 {
return fmt.Errorf("No valid data to update")
}
schedtag, err := modules.Schedtags.Update(s, args.ID, params)
if err != nil {
return err
}
printObject(schedtag)
return nil
})
type SetScopeOptions struct {
ID []string `help:"ID or Name of schetag"`
Project string `help:"ID or Name of project"`
Domain string `help:"ID or Name of domain"`
System bool `help:"Set to system scope"`
}
R(&SetScopeOptions{}, "schedtag-set-scope", "Set schedtag scope", func(s *mcclient.ClientSession, args *SetScopeOptions) error {
params := jsonutils.NewDict()
domainId := args.Domain
projectId := args.Project
if args.System {
domainId = ""
projectId = ""
}
params.Add(jsonutils.NewString(domainId), "domain")
params.Add(jsonutils.NewString(projectId), "project")
ret := modules.Schedtags.BatchPerformAction(s, args.ID, "set-scope", params)
printBatchResults(ret, modules.Schedtags.GetColumns(s))
return nil
})
}

View File

@@ -123,10 +123,9 @@ func init() {
})
type SchedulerHistoryListOptions struct {
Limit int `default:"50" help:"Page limit"`
Offset int `default:"0" help:"Page offset"`
All bool `help:"Show all histories, including scheduler-test"`
IsSuggestion bool `help:"Only show forcast suggestion history"`
Limit int `default:"50" help:"Page limit"`
Offset int `default:"0" help:"Page offset"`
All bool `help:"Show all histories, including scheduler-test"`
}
R(&SchedulerHistoryListOptions{}, "scheduler-history-list", "Show scheduler history list",
func(s *mcclient.ClientSession, args *SchedulerHistoryListOptions) error {
@@ -139,14 +138,17 @@ func init() {
if args.Offset > 0 {
params.Add(jsonutils.NewInt(int64(args.Offset)), "offset")
}
params.Add(jsonutils.NewBool(args.All), "all")
params.Add(jsonutils.NewBool(args.IsSuggestion), "is_suggestion")
if args.All {
params.Add(jsonutils.JSONTrue, "all")
} else {
params.Add(jsonutils.JSONFalse, "all")
}
result, err := modules.SchedManager.HistoryList(s, params)
if err != nil {
return err
}
printList(modulebase.JSON2ListResult(result), []string{
"session_id", "time", "status", "consuming", "is_suggestion",
"session_id", "time", "status", "consuming",
})
return nil
})

View File

@@ -34,6 +34,4 @@ func init() {
cmd.Perform("cache-secgroup", &options.SecurityGroupCacheOptions{})
cmd.Perform("uncache-secgroup", &options.SecurityGroupUncacheSecurityGroup{})
cmd.Perform("purge", &options.SecgroupIdOptions{})
cmd.Perform("change-owner", &options.SecgroupChangeOwnerOptions{})
cmd.Perform("import-rules", &options.SecgroupImportRulesOptions{})
}

View File

@@ -728,7 +728,6 @@ func init() {
type ServerRollBackSnapshot struct {
ID string `help:"ID or name of VM" json:"-"`
InstanceSnapshot string `help:"Instance snapshot id or name" json:"instance_snapshot"`
AutoStart bool `help:"Auto start VM"`
}
R(&ServerRollBackSnapshot{}, "instance-snapshot-reset", "reset instance snapshot", func(s *mcclient.ClientSession, opts *ServerRollBackSnapshot) error {
params := jsonutils.Marshal(opts)

View File

@@ -15,31 +15,194 @@
package compute
import (
"yunion.io/x/onecloud/cmd/climc/shell"
"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() {
cmd := shell.NewResourceCmd(&modules.ServerSkus).WithKeyword("server-sku")
cmd.List(&options.ServerSkusListOptions{})
cmd.Show(&options.ServerSkusIdOptions{})
cmd.Delete(&options.ServerSkusIdOptions{})
cmd.Perform("enable", &options.ServerSkusIdOptions{})
cmd.Perform("disable", &options.ServerSkusIdOptions{})
cmd.Create(&options.ServerSkusCreateOptions{})
cmd.Update(&options.ServerSkusUpdateOptions{})
cmd.ClassShow(&options.ServerSkusListOptions{})
cmd.PerformClass("sync-skus", &options.SkuSyncOptions{})
type ServerSkusListOptions struct {
options.BaseListOptions
Cloudregion string `help:"region Id or name"`
Usable bool `help:"Filter usable sku"`
Zone string `help:"zone Id or name"`
City *string `help:"city name,eg. BeiJing"`
Cpu *int `help:"Cpu core count" json:"cpu_core_count"`
Mem *int `help:"Memory size in MB" json:"memory_size_mb"`
Name string `help:"Name of Sku"`
PostpaidStatus string `help:"Postpaid status" choices:"soldout|available"`
PrepaidStatus string `help:"Prepaid status" choices:"soldout|available"`
}
R(&options.SkuTaskQueryOptions{}, "server-sku-sync-task-show", "Show details of skus sync tasks", func(s *mcclient.ClientSession, args *options.SkuTaskQueryOptions) error {
params, err := args.Params()
R(&ServerSkusListOptions{}, "server-sku-list", "List all avaiable Server SKU", func(s *mcclient.ClientSession, args *ServerSkusListOptions) error {
params, err := options.ListStructToParams(args)
if err != nil {
return err
}
results, err := modules.ServerSkus.List(s, params)
if err != nil {
return err
}
printList(results, modules.ServerSkus.GetColumns(s))
return nil
})
result, err := modules.ServerSkus.Get(s, "sync-tasks", params)
type ServerSkusIdOptions struct {
ID string `help:"ID or Name of SKU to show"`
}
R(&ServerSkusIdOptions{}, "server-sku-show", "show details of a avaiable Server SKU", func(s *mcclient.ClientSession, args *ServerSkusIdOptions) error {
result, err := modules.ServerSkus.Get(s, args.ID, nil)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&ServerSkusIdOptions{}, "server-sku-enable", "Enable Server SKU", func(s *mcclient.ClientSession, args *ServerSkusIdOptions) error {
result, err := modules.ServerSkus.PerformAction(s, args.ID, "enable", nil)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&ServerSkusIdOptions{}, "server-sku-disable", "Disable Server SKU", func(s *mcclient.ClientSession, args *ServerSkusIdOptions) error {
result, err := modules.ServerSkus.PerformAction(s, args.ID, "disable", nil)
if err != nil {
return err
}
printObject(result)
return nil
})
type ServerSkusCacheOptions struct {
REGION string `help:"Private cloud region"`
ID string `help:"ServerSku Id"`
}
R(&ServerSkusCacheOptions{}, "server-sku-cache", "Cache Server SKU for private cloud", func(s *mcclient.ClientSession, args *ServerSkusCacheOptions) error {
params := jsonutils.NewDict()
params.Add(jsonutils.NewString(args.REGION), "cloudregion")
result, err := modules.ServerSkus.PerformAction(s, args.ID, "cache-sku", params)
if err != nil {
return err
}
printObject(result)
return nil
})
type ServerSkusCreateOptions struct {
Name string `help:"ServerSku name"`
CpuCoreCount int `help:"Cpu Count" required:"true" positional:"true"`
MemorySizeMB int `help:"Memory MB" required:"true" positional:"true"`
OsName *string `help:"OS name/type" choices:"Linux|Windows|Any" default:"Any"`
InstanceTypeCategory *string `help:"instance type category" choices:"general_purpose|compute_optimized|memory_optimized|storage_optimized|hardware_accelerated|high_memory|high_storage"`
SysDiskResizable *bool `help:"system disk is resizable"`
SysDiskType *string `help:"system disk type" default:"local" choices:"local"`
SysDiskMaxSizeGB *int `help:"system disk maximal size in gb"`
AttachedDiskType *string `help:"attached data disk type"`
AttachedDiskSizeGB *int `help:"attached data disk size in GB"`
AttachedDiskCount *int `help:"attached data disk count"`
MaxDataDiskCount *int `help:"maximal allowed data disk count"`
NicType *string `help:"nic type"`
MaxNicCount *int `help:"maximal nic count"`
GPUSpec *string `help:"GPU spec"`
GPUCount *int `help:"GPU count"`
GPUAttachable *bool `help:"Allow attach GPU"`
Zone *string `help:"Zone ID or name"`
Cloudregion *string `help:"Cloudregion ID or name"`
Provider string `help:"provider"`
Brand string `help:"brand"`
}
R(&ServerSkusCreateOptions{}, "server-sku-create", "Create a server sku record", func(s *mcclient.ClientSession, args *ServerSkusCreateOptions) error {
params, err := options.StructToParams(args)
if err != nil {
return err
}
result, err := modules.ServerSkus.Create(s, params)
if err != nil {
return err
}
printObject(result)
return nil
})
type ServerSkusUpdateOptions struct {
ID string `help:"Name or ID of SKU" json:"-"`
PostpaidStatus *string `help:"skus available status for postpaid instance" choices:"available|soldout"`
PrepaidStatus *string `help:"skus available status for prepaid instance" choices:"available|soldout"`
CpuCoreCount *int `help:"Cpu Count"`
MemorySizeMB *int `help:"Memory MB"`
InstanceTypeCategory *string `help:"instance type category" choices:"general_purpose|compute_optimized|memory_optimized|storage_optimized|hardware_accelerated|high_memory|high_storage"`
SysDiskResizable *bool `help:"system disk is resizable"`
SysDiskMaxSizeGB *int `help:"system disk maximal size in gb"`
AttachedDiskType *string `help:"attached data disk type"`
AttachedDiskSizeGB *int `help:"attached data disk size in GB"`
AttachedDiskCount *int `help:"attached data disk count"`
MaxDataDiskCount *int `help:"maximal allowed data disk count"`
NicType *string `help:"nic type"`
MaxNicCount *int `help:"maximal nic count"`
GPUSpec *string `help:"GPU spec"`
GPUCount *int `help:"GPU count"`
GPUAttachable *bool `help:"Allow attach GPU"`
Zone *string `help:"Zone ID or name"`
Region *string `help:"Region ID or name"`
}
R(&ServerSkusUpdateOptions{}, "server-sku-update", "Update server sku attributes", func(s *mcclient.ClientSession, args *ServerSkusUpdateOptions) error {
params, err := options.StructToParams(args)
if err != nil {
return err
}
result, err := modules.ServerSkus.Update(s, args.ID, params)
if err != nil {
return err
}
printObject(result)
return nil
})
type ServerSkusDeleteOptions struct {
ID string `help:"Id or name of server sku"`
Purge bool `help:"purge sku"`
}
R(&ServerSkusDeleteOptions{}, "server-sku-delete", "Delete a server sku", func(s *mcclient.ClientSession, args *ServerSkusDeleteOptions) error {
params := jsonutils.NewDict()
if args.Purge {
params.Add(jsonutils.JSONTrue, "purge")
}
result, err := modules.ServerSkus.Delete(s, args.ID, params)
if err != nil {
return err
}
printObject(result)
return nil
})
R(&ServerSkusListOptions{}, "server-sku-specs-list", "List all avaiable Server SKU specifications", func(s *mcclient.ClientSession, args *ServerSkusListOptions) error {
params, err := options.ListStructToParams(args)
if err != nil {
return err
}
result, err := modules.ServerSkus.Get(s, "instance-specs", params)
if err != nil {
return err
}

View File

@@ -61,14 +61,13 @@ func init() {
ID string `help:"ID or Name of storage to update"`
Name string `help:"New Name of storage"`
Desc string `help:"Description"`
CommitBound float64 `help:"Upper bound of storage overcommit rate" json:"cmtbound"`
CommitBound float64 `help:"Upper bound of storage overcommit rate"`
MediumType string `help:"Medium type" choices:"ssd|rotate"`
RbdRadosMonOpTimeout int64 `help:"ceph rados_mon_op_timeout"`
RbdRadosOsdOpTimeout int64 `help:"ceph rados_osd_op_timeout"`
RbdClientMountTimeout int64 `help:"ceph client_mount_timeout"`
RbdKey string `help:"ceph rbd key"`
Reserved string `help:"Reserved storage space"`
Capacity int `help:"Capacity for storage"`
}
R(&StorageUpdateOptions{}, "storage-update", "Update a storage", func(s *mcclient.ClientSession, args *StorageUpdateOptions) error {
params, err := options.StructToParams(args)

View File

@@ -1,31 +0,0 @@
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package compute
import (
"yunion.io/x/onecloud/cmd/climc/shell"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func init() {
cmd := shell.NewResourceCmd(&modules.VpcPeeringConnections).WithKeyword("vpc-peering-connection")
cmd.List(&options.VpcPeeringConnectionListOptions{})
cmd.Show(&options.VpcPeeringConnectionIdOptions{})
cmd.Create(&options.VpcPeeringConnectionCreateOptions{})
cmd.Delete(&options.VpcPeeringConnectionIdOptions{})
cmd.Perform("sync", &options.VpcPeeringConnectionIdOptions{})
cmd.Perform("syncstatus", &options.VpcPeeringConnectionIdOptions{})
}

View File

@@ -16,7 +16,6 @@ package compute
import (
"yunion.io/x/onecloud/cmd/climc/shell"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
@@ -36,17 +35,4 @@ func init() {
cmd.Perform("public", &options.BasePublicOptions{})
cmd.Perform("change-owner", &options.VpcChangeOwnerOptions{})
cmd.Get("vpc-change-owner-candidate-domains", &options.VpcIdOptions{})
R(&options.ResourceMetadataOptions{}, "vpc-set-user-metadata", "Set metadata of a vpc", func(s *mcclient.ClientSession, opts *options.ResourceMetadataOptions) error {
params, err := opts.Params()
if err != nil {
return err
}
result, err := modules.Vpcs.PerformAction(s, opts.ID, "user-metadata", params)
if err != nil {
return err
}
printObject(result)
return nil
})
}

View File

@@ -42,24 +42,34 @@ func init() {
if err != nil {
return err
}
resp := &webconsole_api.ServerRemoteConsoleResponse{}
if err := obj.Unmarshal(resp); err != nil {
connParams, err := obj.GetString("connect_params")
if err != nil {
return err
}
connectParams := resp.GetConnectParams()
if protocol, err := resp.GetConnectProtocol(); err != nil {
return err
} else if !utils.IsInStringArray(protocol, []string{
if decodeStr, err := base64.StdEncoding.DecodeString(connParams); err == nil {
connParams = string(decodeStr)
}
var query url.Values
connUrl, err := url.ParseRequestURI(connParams)
if err == nil {
query = connUrl.Query()
} else {
query, err = url.ParseQuery(connParams)
if err != nil {
return err
}
}
protocol := query.Get("protocol")
if !utils.IsInStringArray(protocol, []string{
command.PROTOCOL_TTY, webconsole_api.VNC,
webconsole_api.SPICE, webconsole_api.WMKS,
}) {
fmt.Println(connectParams)
fmt.Println(connParams)
return nil
}
newQuery := url.Values{}
newQuery.Set("data", base64.StdEncoding.EncodeToString([]byte(connectParams)))
newQuery := url.Values(make(map[string][]string))
newQuery.Set("data", base64.StdEncoding.EncodeToString([]byte(connParams)))
u.RawQuery = newQuery.Encode()
fmt.Println(u.String())
return nil

View File

@@ -1,70 +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 events
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"
)
func init() {
type EventSplitableOptions struct {
Service string `help:"service" choices:"compute|identity|image" default:"compute"`
}
R(&EventSplitableOptions{}, "logs-splitable", "Show splitable info of event table", func(s *mcclient.ClientSession, args *EventSplitableOptions) error {
var results jsonutils.JSONObject
var err error
switch args.Service {
case "identity":
results, err = modules.IdentityLogs.Get(s, "splitable", nil)
case "image":
results, err = modules.ImageLogs.Get(s, "splitable", nil)
default:
results, err = modules.Logs.Get(s, "splitable", nil)
}
if err != nil {
return err
}
tables, err := results.GetArray()
if err != nil {
return err
}
listResult := &modulebase.ListResult{
Data: tables,
}
printList(listResult, nil)
return nil
})
R(&EventSplitableOptions{}, "logs-purge", "Purge obsolete splitable of event table", func(s *mcclient.ClientSession, args *EventSplitableOptions) error {
var results jsonutils.JSONObject
var err error
switch args.Service {
case "identity":
results, err = modules.IdentityLogs.PerformClassAction(s, "purge-splitable", nil)
case "image":
results, err = modules.ImageLogs.PerformClassAction(s, "purge-splitable", nil)
default:
results, err = modules.Logs.PerformClassAction(s, "purge-splitable", nil)
}
if err != nil {
return err
}
printObject(results)
return nil
})
}

View File

@@ -78,11 +78,6 @@ type ICreateOpt interface {
IOpt
}
type IBatchCreateOpt interface {
IOpt
GetCountParam() int
}
func (cmd ResourceCmd) RunWithDesc(action, desc string, args interface{}, callback interface{}) {
man := cmd.manager
prefix := cmd.prefix
@@ -139,48 +134,20 @@ func (cmd ResourceCmd) List(args IListOpt) {
}
func (cmd ResourceCmd) Create(args ICreateOpt) {
cmd.CreateWithKeyword("create", args)
}
func (cmd ResourceCmd) CreateWithKeyword(keyword string, args ICreateOpt) {
cmd.Run(keyword, args, cmd.create)
}
func (cmd ResourceCmd) create(s *mcclient.ClientSession, args ICreateOpt) error {
man := cmd.manager
params, err := args.Params()
if err != nil {
return err
callback := func(s *mcclient.ClientSession, args ICreateOpt) error {
params, err := args.Params()
if err != nil {
return err
}
ret, err := man.(modulebase.Manager).Create(s, params)
if err != nil {
return err
}
printObject(ret)
return nil
}
ret, err := man.(modulebase.Manager).Create(s, params)
if err != nil {
return err
}
printObject(ret)
return nil
}
func (cmd ResourceCmd) BatchCreate(args IBatchCreateOpt) {
cmd.BatchCreateWithKeyword("create", args)
}
func (cmd ResourceCmd) BatchCreateWithKeyword(keyword string, args IBatchCreateOpt) {
cmd.Run(keyword, args, cmd.batchCreate)
}
func (cmd ResourceCmd) batchCreate(s *mcclient.ClientSession, args IBatchCreateOpt) error {
man := cmd.manager.(modulebase.Manager)
count := args.GetCountParam()
if count <= 1 {
return cmd.create(s, args)
}
params, err := args.Params()
if err != nil {
return err
}
rets := man.BatchCreate(s, params, count)
printBatchResults(rets, man.GetColumns(s))
return nil
cmd.Run("create", args, callback)
}
type IIdOpt interface {
@@ -314,13 +281,10 @@ type IPerformOpt interface {
IIdOpt
}
func (cmd ResourceCmd) PerformWithKeyword(keyword, action string, args IPerformOpt) {
func (cmd ResourceCmd) Perform(action string, args IPerformOpt) {
man := cmd.manager
callback := func(s *mcclient.ClientSession, args IPerformOpt) error {
params, err := args.Params()
if err != nil {
return err
}
params := jsonutils.Marshal(args) // .Params()
ret, err := man.(modulebase.Manager).PerformAction(s, args.GetId(), action, params)
if err != nil {
return err
@@ -328,28 +292,7 @@ func (cmd ResourceCmd) PerformWithKeyword(keyword, action string, args IPerformO
printObject(ret)
return nil
}
cmd.Run(keyword, args, callback)
}
func (cmd ResourceCmd) PerformClassWithKeyword(keyword, action string, args IOpt) {
man := cmd.manager
callback := func(s *mcclient.ClientSession, args IOpt) error {
params, err := args.Params()
if err != nil {
return err
}
ret, err := man.(modulebase.Manager).PerformClassAction(s, action, params)
if err != nil {
return err
}
printObject(ret)
return nil
}
cmd.Run(keyword, args, callback)
}
func (cmd ResourceCmd) Perform(action string, args IPerformOpt) {
cmd.PerformWithKeyword(action, action, args)
cmd.Run(action, args, callback)
}
func (cmd ResourceCmd) PerformClass(action string, args IOpt) {
@@ -415,18 +358,13 @@ type IUpdateOpt interface {
IIdOpt
}
func (cmd ResourceCmd) UpdateWithKeyword(keyword string, args IUpdateOpt) {
func (cmd ResourceCmd) Update(args IUpdateOpt) {
man := cmd.manager
callback := func(s *mcclient.ClientSession, args IUpdateOpt) error {
_params, err := args.Params()
params, err := args.Params()
if err != nil {
return err
}
params := _params.(*jsonutils.JSONDict)
params.Remove("id")
if params.Length() == 0 {
return InvalidUpdateError()
}
ret, err := man.(modulebase.Manager).Update(s, args.GetId(), params)
if err != nil {
return err
@@ -434,11 +372,7 @@ func (cmd ResourceCmd) UpdateWithKeyword(keyword string, args IUpdateOpt) {
printObject(ret)
return nil
}
cmd.Run(keyword, args, callback)
}
func (cmd ResourceCmd) Update(args IUpdateOpt) {
cmd.UpdateWithKeyword("update", args)
cmd.Run("update", args, callback)
}
type IMetadataOpt interface {

View File

@@ -25,8 +25,7 @@ import (
func init() {
type DomainListOptions struct {
options.BaseListOptions
IdpId string `help:"filter by idp_id"`
IdpEntityId string `help:"filter by idp_entity_id"`
IdpId string `help:"filter by idp_id"`
}
R(&DomainListOptions{}, "domain-list", "List domains", func(s *mcclient.ClientSession, args *DomainListOptions) error {
params, err := options.ListStructToParams(args)
@@ -156,16 +155,4 @@ func init() {
return nil
})
type DomainUnlinkIdpOptions struct {
DOMAIN string `help:"ID or name of domain to operate" json:"-"`
}
R(&DomainUnlinkIdpOptions{}, "domain-unlink-idp", "Unlink domain from an entity in the speicified identity provider", func(s *mcclient.ClientSession, args *DomainUnlinkIdpOptions) error {
result, err := modules.Domains.PerformAction(s, args.DOMAIN, "unlink-idp", nil)
if err != nil {
return err
}
printObject(result)
return nil
})
}

View File

@@ -265,12 +265,9 @@ func init() {
type IdentityProviderCreateCASOptions struct {
NAME string `help:"name of identity provider" json:"-"`
AutoCreateProject bool `help:"automatically create a project if the default_project not exists" json:"-"`
AutoCreateProject bool `help:"automatically create a default project when importing domain" json:"-"`
NoAutoCreateProject bool `help:"do not create default project when importing domain" json:"-"`
AutoCreateUser bool `help:"automatically create a user" json:"-"`
NoAutoCreateUser bool `help:"do not automatically create a user" json:"-"`
TargetDomain string `help:"target domain without creating new domain" json:"-"`
api.SCASIdpConfigOptions
@@ -287,11 +284,6 @@ func init() {
} else if args.NoAutoCreateProject {
params.Add(jsonutils.JSONFalse, "auto_create_project")
}
if args.AutoCreateUser {
params.Add(jsonutils.JSONTrue, "auto_create_user")
} else if args.NoAutoCreateUser {
params.Add(jsonutils.JSONFalse, "auto_create_user")
}
params.Add(jsonutils.NewString("cas"), "driver")
params.Add(jsonutils.Marshal(args), "config", "cas")
@@ -472,9 +464,6 @@ func init() {
AutoCreateProject bool `help:"automatically create a default project when importing domain" json:"-"`
NoAutoCreateProject bool `help:"do not create default project when importing domain" json:"-"`
AutoCreateUser bool `help:"automatically create a user" json:"-"`
NoAutoCreateUser bool `help:"do not automatically create a user" json:"-"`
TargetDomain string `help:"target domain without creating new domain" json:"-"`
api.SOIDCIdpConfigOptions
@@ -491,11 +480,6 @@ func init() {
} else if args.NoAutoCreateProject {
params.Add(jsonutils.JSONFalse, "auto_create_project")
}
if args.AutoCreateUser {
params.Add(jsonutils.JSONTrue, "auto_create_user")
} else if args.NoAutoCreateUser {
params.Add(jsonutils.JSONFalse, "auto_create_user")
}
params.Add(jsonutils.NewString("oidc"), "driver")
params.Add(jsonutils.Marshal(args), "config", "oidc")
@@ -722,18 +706,4 @@ func init() {
printObject(result)
return nil
})
type IdpSetDefaultSsoOptions struct {
ID string `help:"id or name of idp to set default Sso" json:"-"`
api.PerformDefaultSsoInput
}
R(&IdpSetDefaultSsoOptions{}, "idp-default-sso", "Enable/disable default SSO", func(s *mcclient.ClientSession, args *IdpSetDefaultSsoOptions) error {
result, err := modules.IdentityProviders.PerformAction(s, args.ID, "default-sso", jsonutils.Marshal(args))
if err != nil {
return err
}
printObject(result)
return nil
})
}

View File

@@ -24,14 +24,12 @@ import (
"yunion.io/x/jsonutils"
"yunion.io/x/log"
api "yunion.io/x/onecloud/pkg/apis/identity"
"yunion.io/x/onecloud/pkg/cloudcommon/consts"
"yunion.io/x/onecloud/pkg/cloudcommon/policy"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/auth"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
"yunion.io/x/onecloud/pkg/util/fileutils2"
"yunion.io/x/onecloud/pkg/util/rbacutils"
"yunion.io/x/onecloud/pkg/util/shellutils"
)
@@ -40,7 +38,6 @@ func init() {
type PolicyListOptions struct {
options.BaseListOptions
Type string `help:"filter by type"`
IsSystem *bool `help:"filter by is_system" negative:"is_no_system"`
Format string `help:"policy format, default to yaml" default:"yaml" choices:"yaml|json"`
OrderByDomain string `help:"order by domain name" choices:"asc|desc"`
}
@@ -64,8 +61,6 @@ func init() {
Enabled bool `help:"create policy enabled"`
Disabled bool `help:"create policy disabled"`
Desc string `help:"policy description"`
Scope string `help:"scope of policy"`
IsSystem *bool `help:"create system policy" negative:"no-system"`
}
R(&PolicyCreateOptions{}, "policy-create", "Create a new policy", func(s *mcclient.ClientSession, args *PolicyCreateOptions) error {
policyBytes, err := ioutil.ReadFile(args.FILE)
@@ -87,16 +82,6 @@ func init() {
if len(args.Desc) > 0 {
params.Add(jsonutils.NewString(args.Desc), "description")
}
if len(args.Scope) > 0 {
params.Add(jsonutils.NewString(args.Scope), "scope")
}
if args.IsSystem != nil {
if *args.IsSystem {
params.Add(jsonutils.JSONTrue, "is_system")
} else {
params.Add(jsonutils.JSONFalse, "is_system")
}
}
result, err := modules.Policies.Create(s, params)
if err != nil {
@@ -115,7 +100,6 @@ func init() {
Enabled bool `help:"update policy enabled"`
Disabled bool `help:"update policy disabled"`
Desc string `help:"Description"`
IsSystem *bool `help:"is_system"`
}
updateFunc := func(s *mcclient.ClientSession, args *PolicyPatchOptions) error {
policyId, err := modules.Policies.GetId(s, args.ID, nil)
@@ -141,13 +125,6 @@ func init() {
if len(args.Desc) > 0 {
params.Add(jsonutils.NewString(args.Desc), "description")
}
if args.IsSystem != nil {
if *args.IsSystem {
params.Add(jsonutils.JSONTrue, "is_system")
} else {
params.Add(jsonutils.JSONFalse, "is_system")
}
}
result, err := modules.Policies.Patch(s, policyId, params)
if err != nil {
return err
@@ -206,7 +183,6 @@ func init() {
type PolicyShowOptions struct {
ID string `help:"ID of policy"`
Format string `help:"policy format, default yaml" default:"yaml" choices:"yaml|json"`
Save string `help:"save policy data into a file"`
}
R(&PolicyShowOptions{}, "policy-show", "Show policy", func(s *mcclient.ClientSession, args *PolicyShowOptions) error {
query := jsonutils.NewDict()
@@ -216,15 +192,6 @@ func init() {
return err
}
printObject(result)
if len(args.Save) > 0 {
if args.Format == "yaml" {
yaml, _ := result.GetString("policy")
fileutils2.FilePutContents(args.Save, yaml, false)
} else {
p, _ := result.Get("policy")
fileutils2.FilePutContents(args.Save, p.PrettyString(), false)
}
}
return nil
})
@@ -264,32 +231,16 @@ func init() {
return nil
})
type PolicyBindRoleOptions struct {
POLICY string `json:"-" help:"policy Id or name"`
api.PolicyBindRoleInput
}
R(&PolicyBindRoleOptions{}, "policy-bind-role", "Policy bind role", func(s *mcclient.ClientSession, args *PolicyBindRoleOptions) error {
params := jsonutils.Marshal(args)
log.Debugf("params: %s", params)
result, err := modules.Policies.PerformAction(s, args.POLICY, "bind-role", params)
if err != nil {
return err
}
printObject(result)
return nil
})
type PolicyAdminCapableOptions struct {
User string `help:"For user"`
UserDomain string `help:"Domain for user"`
Project string `help:"Role assignments for project"`
ProjectDomain string `help:"Domain for project"`
Role []string `help:"Role name list"`
RoleId []string `help:"Role Id list"`
Role []string `help:"Roles"`
}
R(&PolicyAdminCapableOptions{}, "policy-admin-capable", "Check admin capable", func(s *mcclient.ClientSession, args *PolicyAdminCapableOptions) error {
auth.InitFromClientSession(s)
policy.EnableGlobalRbac(15*time.Second, false)
policy.EnableGlobalRbac(15*time.Second, 15*time.Second, false)
var token mcclient.TokenCredential
if len(args.User) > 0 {
@@ -299,7 +250,6 @@ func init() {
Project: args.Project,
ProjectDomain: args.ProjectDomain,
Roles: strings.Join(args.Role, ","),
RoleIds: strings.Join(args.RoleId, ","),
}
} else {
token = s.GetToken()
@@ -327,7 +277,6 @@ func init() {
UserDomain string `help:"Domain for user"`
Project string `help:"Role assignments for project"`
Role []string `help:"Roles"`
RoleId []string `help:"Role Id list"`
Request []string `help:"explain request, in format of key:scope:service:resource:action:extra"`
Name string `help:"policy name"`
Debug bool `help:"enable RBAC debug"`
@@ -343,11 +292,26 @@ func init() {
rbacutils.ShowMatchRuleDebug = true
}
auth.InitFromClientSession(s)
policy.EnableGlobalRbac(15*time.Second, false)
policy.EnableGlobalRbac(15*time.Second, 15*time.Second, false)
if args.Debug {
consts.EnableRbacDebug()
}
findPolicy := false
for !findPolicy {
all := policy.PolicyManager.AllPolicies()
for _, allP := range all {
if len(allP) > 0 {
findPolicy = true
break
}
}
if findPolicy {
break
}
time.Sleep(time.Second)
}
req := jsonutils.NewDict()
for i := 0; i < len(args.Request); i += 1 {
parts := strings.Split(args.Request[i], ":")
@@ -410,7 +374,6 @@ func init() {
ProjectDomain: projDom,
ProjectDomainId: projDomId,
Roles: strings.Join(args.Role, ","),
RoleIds: strings.Join(args.RoleId, ","),
Context: mcclient.SAuthContext{
Ip: args.Ip,
},
@@ -426,7 +389,7 @@ func init() {
}
printObject(result)
/*for _, r := range args.Role {
for _, r := range args.Role {
fmt.Println("role", r, "matched policies:", policy.PolicyManager.RoleMatchPolicies(r))
}
@@ -442,7 +405,7 @@ func init() {
fmt.Println("matched", scope, "policies:", m)
}
fmt.Println("all_policies", policy.PolicyManager.AllPolicies())*/
fmt.Println("all_policies", policy.PolicyManager.AllPolicies())
return nil
})
}

View File

@@ -1,88 +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 identity
import (
"yunion.io/x/jsonutils"
api "yunion.io/x/onecloud/pkg/apis/identity"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules"
)
func init() {
type RolePolicyListOptions struct {
api.RolePolicyListInput
}
R(&RolePolicyListOptions{}, "role-policy-list", "List associated policies of a role", func(s *mcclient.ClientSession, args *RolePolicyListOptions) error {
results, err := modules.RolePolicies.List(s, jsonutils.Marshal(args))
if err != nil {
return err
}
printList(results, modules.RolePolicies.GetColumns(s))
return nil
})
type RoleAddPolicyOptions struct {
ID string `json:"-" help:"role id or name to add policy"`
api.RolePerformAddPolicyInput
}
R(&RoleAddPolicyOptions{}, "role-add-policy", "Add policy to a role", func(s *mcclient.ClientSession, args *RoleAddPolicyOptions) error {
result, err := modules.RolesV3.PerformAction(s, args.ID, "add-policy", jsonutils.Marshal(args))
if err != nil {
return err
}
printObject(result)
return nil
})
type RoleRemovePolicyOptions struct {
ID string `json:"-" help:"role id or name to remove policy"`
api.RolePerformRemovePolicyInput
}
R(&RoleRemovePolicyOptions{}, "role-remove-policy", "Remove policy from a role", func(s *mcclient.ClientSession, args *RoleRemovePolicyOptions) error {
result, err := modules.RolesV3.PerformAction(s, args.ID, "remove-policy", jsonutils.Marshal(args))
if err != nil {
return err
}
printObject(result)
return nil
})
type RoleSetPolicyOptions struct {
ID string `json:"-" help:"role id or name to set policies"`
api.RolePerformSetPoliciesInput
}
R(&RoleSetPolicyOptions{}, "role-set-policies", "Set policies for a role", func(s *mcclient.ClientSession, args *RoleSetPolicyOptions) error {
result, err := modules.RolesV3.PerformAction(s, args.ID, "set-policies", jsonutils.Marshal(args))
if err != nil {
return err
}
printObject(result)
return nil
})
type RolePolicyDeleteOptions struct {
ID string `json:"-" help:"id or role policy binding"`
}
R(&RolePolicyDeleteOptions{}, "role-policy-delete", "Delete role policy binding", func(s *mcclient.ClientSession, args *RolePolicyDeleteOptions) error {
result, err := modules.RolePolicies.Delete(s, args.ID, nil)
if err != nil {
return err
}
printObject(result)
return nil
})
}

View File

@@ -31,7 +31,6 @@ func init() {
OrderByDomain string `help:"order by domain name" choices:"asc|desc"`
Role string `help:"Filter by role"`
IdpId string `help:"filter by idp_id"`
IdpEntityId string `help:"filter by idp_entity_id"`
}
R(&UserListOptions{}, "user-list", "List users", func(s *mcclient.ClientSession, args *UserListOptions) error {
params, err := options.ListStructToParams(args)
@@ -174,8 +173,6 @@ func init() {
IdpId string `help:"Id of identity provider to link with"`
IdpEntityId string `help:"Entity id of identity provider to link with"`
Lang string `help:"user default language"`
}
R(&UserCreateOptions{}, "user-create", "Create a user", func(s *mcclient.ClientSession, args *UserCreateOptions) error {
params := jsonutils.NewDict()
@@ -226,10 +223,6 @@ func init() {
params.Add(jsonutils.NewString(args.IdpEntityId), "idp_entity_id")
}
if len(args.Lang) > 0 {
params.Add(jsonutils.NewString(args.Lang), "lang")
}
/*if len(args.DefaultProject) > 0 {
projId, err := modules.Projects.GetId(s, args.DefaultProject, nil)
if err != nil {
@@ -271,8 +264,6 @@ func init() {
// Option []string `help:"User options"`
SkipPasswordComplexityCheck bool `help:"skip_password_complexity_check"`
Lang string `help:"update user language"`
}
R(&UserUpdateOptions{}, "user-update", "Update a user", func(s *mcclient.ClientSession, args *UserUpdateOptions) error {
query := jsonutils.NewDict()
@@ -329,9 +320,6 @@ func init() {
} else if args.DisableMfa {
params.Add(jsonutils.JSONFalse, "enable_mfa")
}
if len(args.Lang) > 0 {
params.Add(jsonutils.NewString(args.Lang), "lang")
}
// if len(args.DefaultProject) > 0 {
// projId, err := modules.Projects.GetId(s, args.DefaultProject, nil)
// if err != nil {

View File

@@ -29,7 +29,6 @@ func init() {
DetachCluster(new(options.FedResourceJointClusterDetachOptions)).
SyncCluster(new(options.FedResourceJointClusterDetachOptions)).
Sync(new(options.FedResourceIdOptions)).
Update(new(options.FedResourceUpdateOptions)).
ShowEvent()
cmd.ClassShow(new(options.FedApiResourecesOptions))

View File

@@ -29,6 +29,5 @@ func init() {
DetachCluster(new(options.FedResourceJointClusterDetachOptions)).
SyncCluster(new(options.FedResourceJointClusterDetachOptions)).
Sync(new(options.FedResourceIdOptions)).
Update(new(options.FedResourceUpdateOptions)).
ShowEvent()
}

View File

@@ -15,15 +15,7 @@
package k8s
import (
"fmt"
"github.com/ghodss/yaml"
"yunion.io/x/jsonutils"
"yunion.io/x/pkg/errors"
"yunion.io/x/onecloud/cmd/climc/shell"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modulebase"
)
@@ -77,51 +69,3 @@ func (c *fedResourceCmd) Sync(args shell.IPerformOpt) *fedResourceCmd {
c.K8sResourceCmd.Perform("sync", args)
return c
}
type iFedResUpdateOpt interface {
shell.IShowOpt
GetUpdateFields() []string
}
func (c *fedResourceCmd) Update(args iFedResUpdateOpt) *fedResourceCmd {
man := c.manager
fields := args.GetUpdateFields()
callback := func(s *mcclient.ClientSession, args iFedResUpdateOpt) error {
params, err := args.Params()
if err != nil {
return err
}
ret, err := man.(modulebase.Manager).Get(s, args.GetId(), params)
if err != nil {
return err
}
updateData := jsonutils.NewDict()
for _, field := range fields {
up, err := ret.Get(field)
if err != nil {
return errors.Wrapf(err, "get update field %s", field)
}
updateData.Add(up, field)
}
content, err := FileTempEdit(args.GetId(), "yaml", updateData.YAMLString())
if err != nil {
return errors.Wrap(err, "edit tempfile")
}
jsonBytes, err := yaml.YAMLToJSON([]byte(content))
if err != nil {
return errors.Wrap(err, "yaml to json")
}
updateBody, err := jsonutils.Parse(jsonBytes)
if err != nil {
return errors.Wrap(err, "parse json bytes")
}
ret, err = man.(modulebase.Manager).Update(s, args.GetId(), updateBody)
if err != nil {
return err
}
printObject(ret)
return nil
}
c.RunWithDesc("update", fmt.Sprintf("Update %s of a %s", fields, man.GetKeyword()), args, callback)
return c
}

View File

@@ -30,6 +30,5 @@ func init() {
DetachCluster(new(options.FedResourceJointClusterDetachOptions)).
SyncCluster(new(options.FedResourceJointClusterDetachOptions)).
Sync(new(options.IdentOptions)).
Update(new(options.FedResourceUpdateOptions)).
ShowEvent()
}

View File

@@ -29,7 +29,6 @@ func init() {
DetachCluster(new(options.FedResourceJointClusterDetachOptions)).
SyncCluster(new(options.FedResourceJointClusterDetachOptions)).
Sync(new(options.IdentOptions)).
Update(new(options.FedResourceUpdateOptions)).
ShowEvent()
cmd.ClassShow(new(options.FedApiResourecesOptions))

View File

@@ -23,7 +23,6 @@ import (
"github.com/ghodss/yaml"
"yunion.io/x/jsonutils"
"yunion.io/x/pkg/errors"
"yunion.io/x/onecloud/cmd/climc/shell"
"yunion.io/x/onecloud/cmd/climc/shell/events"
@@ -57,31 +56,6 @@ func (cmd *K8sResourceCmd) ShowEvent() *K8sResourceCmd {
return cmd
}
func FileTempEdit(prefix, suffix string, input string) (string, error) {
tempfile, err := ioutil.TempFile("", fmt.Sprintf("k8s-%s*.%s", prefix, suffix))
if err != nil {
return "", errors.Wrap(err, "New tempfile")
}
defer os.Remove(tempfile.Name())
if _, err := tempfile.Write([]byte(input)); err != nil {
return "", errors.Wrap(err, "write tempfile")
}
if err := tempfile.Close(); err != nil {
return "", err
}
cmd := exec.Command("vim", tempfile.Name())
cmd.Stdin = os.Stdin
cmd.Stdout = os.Stdout
if err := cmd.Run(); err != nil {
return "", err
}
content, err := ioutil.ReadFile(tempfile.Name())
if err != nil {
return "", errors.Wrapf(err, "read file %s", tempfile.Name())
}
return string(content), nil
}
func (cmd *K8sResourceCmd) EditRaw(opt shell.IGetOpt) *K8sResourceCmd {
man := cmd.GetClusterResManager()
callback := func(s *mcclient.ClientSession, args shell.IGetOpt) error {

View File

@@ -1,15 +0,0 @@
package monitor
import (
"yunion.io/x/onecloud/cmd/climc/shell"
"yunion.io/x/onecloud/pkg/mcclient/modules"
options "yunion.io/x/onecloud/pkg/mcclient/options/monitor"
)
func init() {
cmd := shell.NewResourceCmd(modules.AlertPanelManager)
cmd.Create(new(options.AlertPanelCreateOptions))
cmd.List(new(options.AlertPanelListOptions))
cmd.Show(new(options.AlertPanelShowOptions))
cmd.Delete(new(options.AlertPanelDeleteOptions))
}

View File

@@ -10,5 +10,4 @@ func init() {
cmd := shell.NewResourceCmd(modules.AlertRecordManager)
cmd.List(new(options.AlertRecordListOptions))
cmd.Show(new(options.AlertRecordShowOptions))
cmd.Get("", new(options.AlertRecordTotalOptions))
}

View File

@@ -0,0 +1,67 @@
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package monitor
import (
"yunion.io/x/jsonutils"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules/monitor"
options "yunion.io/x/onecloud/pkg/mcclient/options/monitor"
)
func init() {
aN := cmdN("suggestsysalert")
R(&options.SuggestSysAlertListOptions{}, aN("list"), "List all suggestsysrules",
func(s *mcclient.ClientSession, args *options.SuggestSysAlertListOptions) error {
params, err := args.Params()
if err != nil {
return err
}
if len(args.Type) > 0 {
params.Add(jsonutils.NewString(args.Type), "type")
}
ret, err := monitor.SuggestSysAlertManager.List(s, params)
if err != nil {
return err
}
printList(ret, monitor.SuggestSysAlertManager.GetColumns(s))
return nil
})
R(&options.SSuggestAlertShowOptions{}, aN("show"), "Show details of a alert rule",
func(s *mcclient.ClientSession, args *options.SSuggestAlertShowOptions) error {
ret, err := monitor.SuggestSysAlertManager.Get(s, args.ID, nil)
if err != nil {
return err
}
printObject(ret)
return nil
})
R(&options.SuggestAlertIgnoreOptions{}, aN("ignore"), "Ignore alert result",
func(s *mcclient.ClientSession, args *options.SuggestAlertIgnoreOptions) error {
params, err := args.Params()
if err != nil {
return err
}
ret, err := monitor.SuggestSysAlertManager.PerformAction(s, args.ID, "ignore", params)
if err != nil {
return err
}
printObject(ret)
return nil
})
}

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