如何恢复hdp [英] How to recover the hdp
本文介绍了如何恢复hdp的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有这个命令行来显示 YARN 策略:
I have this command line to dispaly the YARN policy:
结果是:
{
"id": 131,
"guid": "4d9c3257-0998-42ea-8506-f773a368430d",
"isEnabled": true,
"version": 2,
"service": "Namecluster_yarn",
}
},
"policyItems": [
{
"accesses": [
{
"type": "submit-app",
"isAllowed": true
}
],
"users": [],
"groups": [
"Application_Team_1"
],
"conditions": [],
"delegateAdmin": false
}
],
"denyPolicyItems": [],
"allowExceptions": [],
"denyExceptions": [],
"dataMaskPolicyItems": [],
"rowFilterPolicyItems": []
}
我只想恢复组列表(就我而言,我只有一个组是 Application_Team_1).
I would like recover just the list of the groups (in my case I have just one group is Application_Team_1).
如果可能,我如何通过 API REST 或 shell 恢复组列表?
How can I recover the list of groups via the API REST or shell if it's possible ?
推荐答案
使用jq
:
wget "http://myhost:6080/service/public/v2/api/service/Namecluster_yarn/policy/YARN%20_QueueName/" | jq -r '.policyItems[0].groups[0]'
使用 wget
或 curl
或其他可以输出 JSON 数据的东西.
Use wget
or curl
or something else that can output JSON data.
jq
正在过滤您想要的字符串.注意 -r
选项可以去掉双引号.
jq
is filtering the string you want. Note the -r
option to get rid of double quotes.
这篇关于如何恢复hdp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文