16.20 - 列出策略 (RESTful API) - Teradata Data Mover

Teradata® Data Mover 用户指南

Product
Teradata Data Mover
Release Number
16.20
Published
2021 年 11 月
Content Type
用户指南
Publication ID
B035-4101-107K-CHS
Language
中文 (简体)

概览

使用以下 URL 和方法列出作业、守护程序高级设置和守护程序访问的策略:
说明
URL /datamover/policies
方法 GET
启用安全设置后,只有 Viewpoint 或命令行管理员才能检索守护程序高级和守护程序访问策略类型。非管理员用户只能检查特定作业的策略。

请求标头

Authorization
说明:基本标头身份验证
如果从 viewpoint 调用,则用户必须是 dmcl_admin
JSON 数据类型︰字符串
必需:否,除非已启用 securityMgmt
Portlet-User
说明:viewpoint 用户登录
JSON 数据类型︰字符串
必需:否,除非从 viewpoint 调用
Portlet-Roles
说明:与 viewpoint 用户登录关联的角色
JSON 数据类型:字符串,如果存在多个角色,则以逗号分隔
必需:否,除非从 viewpoint 调用

请求参数

resource_type
说明:与策略关联的资源类型。有效值为:
  • tdrn:datamover:daemon_access
  • tdrn:datamover:daemon_advanced
  • tdrn:datamover:job
JSON 数据类型︰字符串
必需:是
resource_name
说明:与策略关联的资源名称。
JSON 数据类型︰字符串
必需:否,除非 resource_typetdrn:datamover:job

响应参数

无需响应参数。

示例

下面是一个用于列出守护程序访问策略的请求示例:
/datamover/policies?resource_type=tdrn:datamover:daemon_access
下面是守护程序访问策略的成功响应示例:
[ { "service" : "datamover", "type" : "user", "principals" : [ "dn186008" ], "actions" : [ "read", "write", "execute" ], "resources" : [ "tdrn:datamover:daemon_access:*" ] },
{ "service" : "datamover", "type" : "role", "principals" : [ "Administrator" ], "actions" : [ "read", "write", "execute" ], "resources" : [ "tdrn:datamover:daemon_access:*" ] },
{ "service" : "datamover", "type" : "user", "principals" : [ "tester_002" ], "actions" : [ "read", "write" ], "resources" : [ "tdrn:datamover:daemon_access:*" ] },
{ "service" : "datamover", "type" : "role", "principals" : [ "User" ], "actions" : [ "read" ], "resources" : [ "tdrn:datamover:daemon_access:*" ] },
{ "service" : "datamover", "type" : "user", "principals" : [ "abcd" ], "actions" : [ "read", "write", "execute" ], "resources" : [ "tdrn:datamover:daemon_access:*" ] },
{ "service" : "datamover", "type" : "user", "principals" : [ "admin" ], "actions" : [ "read", "write", "execute" ], "resources" : [ "tdrn:datamover:daemon_access:*" ] },
{ "service" : "datamover", "type" : "user", "principals" : [ "tester_001" ], "actions" : [ "read" ], "resources" : [ "tdrn:datamover:daemon_access:*" ] },
{ "service" : "datamover", "type" : "user", "principals" : [ "test_002" ], "actions" : [ "write" ], "resources" : [ "tdrn:datamover:daemon_access:*" ] } ]
下面是用户无权检索策略时的失败响应代码示例:
{ "message" : "When security is on, only commandline super user or viewpoint could retrieve policies for resource type.tdrn:datamover:daemon_access.The user does not have the permission to run GET_GLOBAL_ACCESS_PERMISSIONS command" }