[ 
https://issues.apache.org/jira/browse/SQOOP-1979?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14269004#comment-14269004
 ] 

Richard edited comment on SQOOP-1979 at 1/16/15 9:05 AM:
---------------------------------------------------------

The following is the related Restful API.

{code}
GET /v1/role/{role_name}
{code}
Return details about one particular role with role_name
Return all of them if role_name is null
{code}
GET /v1/role/principal/name/{name}/type/{type}
{code}
Return all roles the particular principal has with principal (name, type)
{code}
GET /v1/role/privilege/{privilege_name}
{code}
Return all roles with the particular privilege (privilege_name)
{code}
PUT /v1/role
{code}
Create new role with role_name. Put data of JsonObject role (role_name)
Update existing role with old_role_name and new_role_name. Put data of 
JsonObject old_role (role_name) and new_role (role_name)
{code}
DELETE /v1/role/{role_name}
{code}

{code}
GET /v1/principal/name/{name}/type/{type}
{code}
Return details about one particular principal with name and type
Return all of them if name is null or type is null or both are null
{code}
GET /v1/principal/role/{role_name}
{code}
Return all principals with the particular role (role_name)
{code}
PUT /v1/principal
{code}
Create new principal with name and type. Put data of JsonObject principal 
(name, type)
Update existing principal with old_name, old_type, new_name, new_type. Put data 
of JsonObject old_principal (name, type) and new_principal (name, type)
{code}
DELETE /v1/principal/name/{name}/type/{type}
{code}
Delete all of them if name is null or type is null
{code}
PUT /v1/grant_role
{code}
Grant a role to a user/group/role
{code}
PUT data of JsonObject role(role_name) and principal (name, type)
{code}
PUT /v1/revoke_role
{code}
Revoke a role to a user/group/role
{code}
PUT data of JsonObject role(role_name) and principal (name, type)
{code}
GET /v1/resource/name/{name}/type/{type}
{code}
Return details about one particular resource with name and type
Return all of them if name is null or type is null or both are null
{code}
PUT /v1/resource
{code}
Create new resource with name and type. Put data of JsonObject resource (name, 
type)
Update existing resource with old_name, old_type, new_name, new_type. Put data 
of JsonObject old_resource (name, type) and new_resource (name, type)
{code}
DELETE /v1/resource/name/{name}/type/{type}
{code}
Delete all of them if name is null or type is null
{code}
GET /v1/privilege/{privilege_name}
{code}
Return details about one particular privilege with privilege_name
Return all of them if name is null or type is null or both are null
{code}
GET /v1/privilege/resource/name/{name}/type/{type}
{code}
Return all privilege with the particular principal (name, type)
{code}
GET /v1/privilege/role/{role_name}
{code}
Return all privilege with the particular role (role_name)
{code}
PUT /v1/privilege
{code}
Create new privilege with resource, action and with_grant_option. Put data of 
JsonObject resource (name, type), action and with_grant_option
Update existing privilege with old_resource, old_action, old_with_grant_option, 
new_resource, new_action and new_with_grant_option. Put data of JsonObject 
old_privilege (resource (name, type), action, with_grant_option) and 
new_privilege (resource (name, type), action, with_grant_option)
{code}
DELETE /v1/privilege/{privilege_name}
DELETE /v1/resource/name/{name}/type/{type}
DELETE 
/v1/resource/name/{name}/type/{type}/action/{action}/with_grant_option/{with_grant_option}
{code}

{code}
PUT /v1/grant_privilege
{code}
Grant a privilege to a role
PUT data of JsonObject role(role_name) and privilege (name)
{code}
PUT /v1/revoke_privilege
{code}
Revoke a privilege to a role
PUT data of JsonObject role(role_name) and privilege (name)


was (Author: richard_zhou):
{code}
GET /v1/role/{rid}
{code}
Return details about one particular role with id:rid
Return all of them if rid equals to "all"
{code}
PUT /v1/role
{code}
Create new role without id:rid
Update existing role with id:rid
{code}
PUT data of JsonObject MRole
{code}
{code}
DELETE /v1/role/{rid}
{code}
{code}
GET /v1/role_user_group/{rugid}
{code}
Return details about one particular role_user_group with id:rugid
Return all of them if rugid equals to "all"
{code}
PUT /v1/role_user_group
{code}
Create new role without id:rugid
Update existing role_user_group with id:rid
{code}
PUT data of JsonObject MRoleUserGroup
{code}
{code}
DELETE /v1/role_user_group/{rugid}
{code}
{code}
GET /v1/privilege/{pid}
{code}
Return details about one particular privilege with id:pid
Return all of them if pid equals to "all"
{code}
PUT /v1/privilege
{code}
Create new role without id:pid
Update existing privilege with id:pid
{code}
PUT data of JsonObject MRoleUserGroup
{code}
{code}
DELETE /v1/privilege/{pid}
{code}

> Rest API support
> ----------------
>
>                 Key: SQOOP-1979
>                 URL: https://issues.apache.org/jira/browse/SQOOP-1979
>             Project: Sqoop
>          Issue Type: Sub-task
>          Components: sqoop2-framework
>            Reporter: Richard
>             Fix For: 1.99.7
>
>
> Handle Rest API in server side to grant/revoke role, etc.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to