Difference between revisions of "UserManagement REST API"

From Gcube Wiki
Jump to: navigation, search
(Delete organization)
 
(27 intermediate revisions by one other user not shown)
Line 1: Line 1:
 +
[[Category:Developer's Guide]]
 
== Organization Management ==
 
== Organization Management ==
 
=== Create organization ===
 
=== Create organization ===
Line 153: Line 154:
 
     Content-Type: application/json
 
     Content-Type: application/json
  
'''HTTP Response:'''
 
  
 +
'''HTTP Response:'''
  
 
''Description:''
 
''Description:''
Line 172: Line 173:
  
 
|}
 
|}
    '''''Example:'''''
 
  
 +
 +
'''''Example:'''''
  
 
Request:
 
Request:
  
      GET<nowiki> <root-uri>/userService/organizationmanager/</nowiki>organizations
+
    GET<nowiki> <root-uri>/userService/organizationmanager/</nowiki>organizations
 
     Response:
 
     Response:
      HTTP/1.1 200 OK
+
    HTTP/1.1 200 OK
      Content-Type: application/json
+
    Content-Type: application/json
      {“organizations<nowiki>”:[</nowiki>
+
    {“organizations<nowiki>”:[</nowiki>
 
       {“name”:“engineering”,”description”:”[http://www.eng.it/ www.eng.it]”},
 
       {“name”:“engineering”,”description”:”[http://www.eng.it/ www.eng.it]”},
 
       {“name”:”venus-c”,”description”:”[http://www.venus-c.eu/ www.venus-c.eu]”}
 
       {“name”:”venus-c”,”description”:”[http://www.venus-c.eu/ www.venus-c.eu]”}
      ]}
+
    ]}
  
 
=== Delete organizations ===
 
=== Delete organizations ===
 
     DELETE<nowiki> <root-uri>/</nowiki>userService/organizationmanager/organizations
 
     DELETE<nowiki> <root-uri>/</nowiki>userService/organizationmanager/organizations
  
'''HTTP Response:'''
 
  
 +
'''HTTP Response:'''
  
 
''Description:''
 
''Description:''
 
 
  
 
{| style="border-spacing:0;"
 
{| style="border-spacing:0;"
Line 209: Line 209:
  
 
|}
 
|}
    '''''Example:'''''
 
  
 +
 +
'''''Example:'''''
  
 
Request:
 
Request:
Line 217: Line 218:
  
 
     Response:
 
     Response:
      HTTP/1.1 200 OK
+
    HTTP/1.1 200 OK
  
 
== Group Management ==
 
== Group Management ==
 
=== Create group ===
 
=== Create group ===
 
     <nowiki>PUT <root-uri>/</nowiki>userService/groupmanager/
 
     <nowiki>PUT <root-uri>/</nowiki>userService/groupmanager/
 
    '''Request Message Body:'''
 
  
  
 +
'''Request Message Body:'''
  
 
{| style="border-spacing:0;"
 
{| style="border-spacing:0;"
Line 252: Line 252:
  
 
|}
 
|}
'''HTTP Response:'''
 
  
 +
'''HTTP Response:'''
  
 
''Description:''
 
''Description:''
Line 271: Line 271:
  
 
|}
 
|}
    '''''Example:'''''
 
  
 +
'''''Example:'''''
  
 
Request:
 
Request:
  
 
     <nowiki> PUT <root-uri>/userService/</nowiki>groupmanager/
 
     <nowiki> PUT <root-uri>/userService/</nowiki>groupmanager/
      Content-Type: application/json
+
    Content-Type: application/json
      {“groupName” : “itpeople”}
+
    {“groupName” : “itpeople”}
  
 
     Response:
 
     Response:
      HTTP/1.1 200 CREATED
+
    HTTP/1.1 200 CREATED
  
 
=== Get group by group name ===
 
=== Get group by group name ===
 
     <nowiki>GET <root-uri>/</nowiki>userService/groupmanager/{groupName}  
 
     <nowiki>GET <root-uri>/</nowiki>userService/groupmanager/{groupName}  
 
    '''Request Message Body:'''
 
  
  
 +
'''Request Message Body:'''
  
 
{| style="border-spacing:0;"
 
{| style="border-spacing:0;"
Line 303: Line 302:
  
 
|}
 
|}
'''HTTP Response:'''
 
  
 +
 +
'''HTTP Response:'''
  
 
''Description:''
 
''Description:''
Line 322: Line 322:
  
 
|}
 
|}
    '''''Example:'''''
 
  
 +
'''''Example:'''''
  
 
Request:
 
Request:
  
      GET<nowiki> <root-uri>/userService/</nowiki>groupmamager<nowiki>/<</nowiki>groupName>  
+
    GET<nowiki> <root-uri>/userService/</nowiki>groupmamager<nowiki>/<</nowiki>groupName>  
 
     Response:
 
     Response:
      HTTP/1.1 200 OK
+
    HTTP/1.1 200 OK
  
 
=== Get group by group name and organization name ===
 
=== Get group by group name and organization name ===
 
  <nowiki>GET <root-uri>/</nowiki>userService/groupmanager/{groupName}/organization/{organizationName}
 
  <nowiki>GET <root-uri>/</nowiki>userService/groupmanager/{groupName}/organization/{organizationName}
 
    '''Request Message Body:'''
 
  
  
 +
'''Request Message Body:'''
  
 
{| style="border-spacing:0;"
 
{| style="border-spacing:0;"
Line 357: Line 356:
  
 
|}
 
|}
'''HTTP Response:'''
 
  
 +
 +
'''HTTP Response:'''
  
 
''Description:''
 
''Description:''
Line 376: Line 376:
  
 
|}
 
|}
    '''''Example:'''''
 
  
 +
 +
'''''Example:'''''
  
 
Request:
 
Request:
  
GET<nowiki> <root-</nowiki>uri>/userService/groupmamager<nowiki>/<</nowiki>groupName>/organization/<nowiki><</nowiki>organizationName>
+
  GET<nowiki> <root-</nowiki>uri>/userService/groupmamager<nowiki>/<</nowiki>groupName>/organization/<nowiki><</nowiki>organizationName>
    Response:
+
  Response:
      HTTP/1.1 200 OK
+
  HTTP/1.1 200 OK
  
 
=== List groups ===
 
=== List groups ===
 
     <nowiki>GET <root-uri>/</nowiki>userService/groupmanager/groups/{organizationName}
 
     <nowiki>GET <root-uri>/</nowiki>userService/groupmanager/groups/{organizationName}
 
     Content-Type: application/json
 
     Content-Type: application/json
 +
  
 
'''Request Message Body:'''
 
'''Request Message Body:'''
 
 
  
 
{| style="border-spacing:0;"
 
{| style="border-spacing:0;"
Line 406: Line 406:
  
 
|}
 
|}
'''HTTP Response:'''
 
  
 +
 +
'''HTTP Response:'''
  
 
''Description:''
 
''Description:''
 
  
 
{| style="border-spacing:0;"
 
{| style="border-spacing:0;"
Line 425: Line 425:
  
 
|}
 
|}
    '''''Example:'''''
 
  
 +
 +
 +
'''''Example:'''''
  
 
Request:
 
Request:
  
      GET<nowiki> <root-uri>/userService/</nowiki>groupmanager/groups
+
    GET<nowiki> <root-uri>/userService/</nowiki>groupmanager/groups
 
     Response:
 
     Response:
      HTTP/1.1 200 OK
+
    HTTP/1.1 200 OK
      Content-Type: application/json
+
    Content-Type: application/json
      {“groups<nowiki>”:[</nowiki>“itpeople”,”admins”]}
+
    {“groups<nowiki>”:[</nowiki>“itpeople”,”admins”]}
  
 
=== Delete group ===
 
=== Delete group ===
 
     <nowiki>DELETE <root-uri>/</nowiki>userService/groupmanager/{groupName}/{organizationName}  
 
     <nowiki>DELETE <root-uri>/</nowiki>userService/groupmanager/{groupName}/{organizationName}  
 
    '''Request Message Body:'''
 
  
  
 +
'''Request Message Body:'''
  
 
{| style="border-spacing:0;"
 
{| style="border-spacing:0;"
Line 462: Line 463:
  
 
|}
 
|}
'''HTTP Response:'''
 
  
 +
 +
'''HTTP Response:'''
  
 
''Description:''
 
''Description:''
Line 481: Line 483:
  
 
|}
 
|}
    '''''Example:'''''
 
  
 +
 +
'''''Example:'''''
  
 
Request:
 
Request:
  
      DELETE<nowiki> <root-uri>/userService/</nowiki>groupmanager/<nowiki><groupName>/</nowiki><nowiki><organization</nowiki>Name>  
+
    DELETE<nowiki> <root-uri>/userService/</nowiki>groupmanager/<nowiki><groupName>/</nowiki><nowiki><organization</nowiki>Name>  
 
     Response:
 
     Response:
      200 DELETED
+
    200 DELETED
  
 
=== Delete all groups ===
 
=== Delete all groups ===
 
     <nowiki>DELETE <root-uri>/</nowiki>userService/groupmanager/groups/{organizationName}  
 
     <nowiki>DELETE <root-uri>/</nowiki>userService/groupmanager/groups/{organizationName}  
 
    '''Request Message Body:'''
 
  
  
 +
'''Request Message Body:'''
  
 
{| style="border-spacing:0;"
 
{| style="border-spacing:0;"
Line 510: Line 512:
  
 
|}
 
|}
'''HTTP Response:'''
 
  
 +
 +
'''HTTP Response:'''
  
 
''Description:''
 
''Description:''
Line 529: Line 532:
  
 
|}
 
|}
    '''''Example:'''''
 
  
 +
 +
'''''Example:'''''
  
 
Request:
 
Request:
  
      DELETE<nowiki> <root-uri>/userService/</nowiki>groupmanager/groups/<nowiki><organization</nowiki>Name>  
+
    DELETE<nowiki> <root-uri>/userService/</nowiki>groupmanager/groups/<nowiki><organization</nowiki>Name>  
 
     Response:
 
     Response:
      200 DELETED
+
    200 DELETED
  
 
=== Update group ===
 
=== Update group ===
 
     <nowiki>POST <root-uri>/</nowiki>userService/groupmanager
 
     <nowiki>POST <root-uri>/</nowiki>userService/groupmanager
 
    '''Request Message Body:'''
 
  
  
 +
'''Request Message Body:'''
  
 
{| style="border-spacing:0;"
 
{| style="border-spacing:0;"
Line 570: Line 573:
  
 
|}
 
|}
'''HTTP Response:'''
 
  
  
''Description:''
+
'''HTTP Response:'''
  
 +
''Description:''
  
 
{| style="border-spacing:0;"
 
{| style="border-spacing:0;"
Line 589: Line 592:
  
 
|}
 
|}
    '''''Example:'''''
 
  
 +
 +
'''''Example:'''''
  
 
Request:
 
Request:
  
      POST<nowiki> <root-uri>/userService/</nowiki>groupmanager
+
    POST<nowiki> <root-uri>/userService/</nowiki>groupmanager
 
     Response:
 
     Response:
      200 UPDATED
+
    200 UPDATED
  
 
== Role Management ==
 
== Role Management ==
 
=== Create role ===
 
=== Create role ===
 
     <nowiki>PUT <root-uri>/</nowiki>userService/rolemanager/{organizationName}
 
     <nowiki>PUT <root-uri>/</nowiki>userService/rolemanager/{organizationName}
 
    '''Request Message Body:'''
 
  
  
 +
'''Request Message Body:'''
  
 
{| style="border-spacing:0;"
 
{| style="border-spacing:0;"
Line 625: Line 628:
  
 
|}
 
|}
'''HTTP Response:'''
 
  
  
''Description:''
+
'''HTTP Response:'''
  
 +
''Description:''
  
 
{| style="border-spacing:0;"
 
{| style="border-spacing:0;"
Line 644: Line 647:
  
 
|}
 
|}
    '''''Example:'''''
 
  
 +
 +
'''''Example:'''''
  
 
Request:
 
Request:
  
 
     <nowiki> PUT <root-uri>/userService/</nowiki>rolemanager/
 
     <nowiki> PUT <root-uri>/userService/</nowiki>rolemanager/
      Content-Type: application/json
+
    Content-Type: application/json
      {“roleName” : “admin”}
+
    {“roleName” : “admin”}
  
     Response:
+
      
 +
Response:
 
       HTTP/1.1 200 CREATED
 
       HTTP/1.1 200 CREATED
  
 
=== List roles ===
 
=== List roles ===
 
     <nowiki>GET <root-uri>/</nowiki>userService/rolemanager/roles/{organizationName}  
 
     <nowiki>GET <root-uri>/</nowiki>userService/rolemanager/roles/{organizationName}  
 
    '''Request Message Body:'''
 
  
  
 +
'''Request Message Body:'''
  
 
{| style="border-spacing:0;"
 
{| style="border-spacing:0;"
Line 676: Line 680:
  
 
|}
 
|}
 +
 +
 
'''HTTP Response:'''
 
'''HTTP Response:'''
 
  
 
''Description:''
 
''Description:''
 
  
 
{| style="border-spacing:0;"
 
{| style="border-spacing:0;"
Line 695: Line 699:
  
 
|}
 
|}
    '''''Example:'''''
 
  
 +
 +
'''''Example:'''''
  
 
Request:
 
Request:
  
      GET<nowiki> <root-uri>/userService/organizationmanager/<organization</nowiki>Name>  
+
    GET<nowiki> <root-uri>/userService/organizationmanager/<organization</nowiki>Name>  
 
     Response:
 
     Response:
      HTTP/1.1 200 OK
+
    HTTP/1.1 200 OK
  
 
=== Get roles of user ===
 
=== Get roles of user ===
 
     <nowiki>GET <root-uri>/</nowiki>userService/rolemanager/users/{userName}/{organizationName}  
 
     <nowiki>GET <root-uri>/</nowiki>userService/rolemanager/users/{userName}/{organizationName}  
  
    '''Request Message Body:'''
+
'''Request Message Body:'''
 
+
 
+
  
 
{| style="border-spacing:0;"
 
{| style="border-spacing:0;"
Line 730: Line 733:
  
 
|}
 
|}
'''HTTP Response:'''
 
  
  
''Description:''
+
'''HTTP Response:'''
  
 +
''Description:''
  
 
{| style="border-spacing:0;"
 
{| style="border-spacing:0;"
Line 749: Line 752:
  
 
|}
 
|}
    '''''Example:'''''
 
  
 +
 +
'''''Example:'''''
  
 
Request:
 
Request:
  
      GET<nowiki> <root-uri>/userService/</nowiki>rolemanager/<nowiki>users/<username>/</nowiki><nowiki><organization</nowiki>Name>  
+
    GET<nowiki> <root-uri>/userService/</nowiki>rolemanager/<nowiki>users/<username>/</nowiki><nowiki><organization</nowiki>Name>  
    Response:
+
 
      HTTP/1.1 200 OK
+
 
 +
Response:
 +
 
 +
    HTTP/1.1 200 OK
  
 
== User Management ==
 
== User Management ==
Line 762: Line 769:
 
     <nowiki>PUT <root-uri>/</nowiki>userService/usermanager/
 
     <nowiki>PUT <root-uri>/</nowiki>userService/usermanager/
  
<tt> Host:cloud.example.com</tt>
+
  <tt> Host:cloud.example.com</tt>
 +
  <tt>Content-Type: application/json</tt>
 +
  <tt>{"username":"newUser",</tt>
 +
  <tt> "firstname":"ggg",</tt>
 +
  <tt> "lastname":"ggg",</tt>
 +
  <tt>"password":"ggg"}</tt>
  
<tt>Content-Type: application/json</tt>
 
 
<tt>{"username":"newUser",</tt>
 
 
<tt> "firstname":"ggg",</tt>
 
 
<tt> "lastname":"ggg",</tt>
 
 
<tt>"password":"ggg"}</tt>
 
  
  
 
'''Request Message Body:'''
 
'''Request Message Body:'''
 
 
  
 
{| style="border-spacing:0;"
 
{| style="border-spacing:0;"
Line 822: Line 823:
  
 
|}
 
|}
'''HTTP Response:'''
 
  
  
Description:
 
  
 +
'''HTTP Response:'''
 +
 +
Description:
  
 
{| style="border-spacing:0;"
 
{| style="border-spacing:0;"
Line 841: Line 843:
  
 
|}
 
|}
    '''''Example:'''''
 
  
 +
 +
'''''Example:'''''
  
 
Request:
 
Request:
Line 848: Line 851:
 
     <nowiki> PUT <root-uri>/userService/</nowiki>usermanager/
 
     <nowiki> PUT <root-uri>/userService/</nowiki>usermanager/
 
     Response:
 
     Response:
      200 CREATED
+
    200 CREATED
  
 
=== Update user ===
 
=== Update user ===
 
     <nowiki>PUT <root-uri>/</nowiki>userService/usermanager/update
 
     <nowiki>PUT <root-uri>/</nowiki>userService/usermanager/update
  
<tt> Host:cloud.example.com</tt>
+
    <tt> Host:cloud.example.com</tt>
 
+
    <tt>Content-Type: application/json</tt>
<tt>Content-Type: application/json</tt>
+
    <tt>{"username":"user1",</tt>
 
+
    <tt> "firstname":"ggg1",</tt>
<tt>{"username":"user1",</tt>
+
    <tt> "lastname":"ggg2",</tt>
 
+
<tt> "firstname":"ggg1",</tt>
+
 
+
<tt> "lastname":"ggg2",</tt>
+
 
+
  
  
 
'''Request Message Body:'''
 
'''Request Message Body:'''
 
 
  
 
{| style="border-spacing:0;"
 
{| style="border-spacing:0;"
Line 931: Line 927:
  
 
|}
 
|}
    '''''Example:'''''
 
  
 +
 +
 +
'''''Example:'''''
  
 
Request:
 
Request:
Line 938: Line 936:
 
     <nowiki> PUT <root-uri>/userService/</nowiki>usermanager/update
 
     <nowiki> PUT <root-uri>/userService/</nowiki>usermanager/update
 
     Response:
 
     Response:
      200 CREATED
+
    200 CREATED
  
 
=== Get user ===
 
=== Get user ===
 
     <nowiki>GET <root-uri>/</nowiki>userService/usermanager/{userName}/{organizationName}
 
     <nowiki>GET <root-uri>/</nowiki>userService/usermanager/{userName}/{organizationName}
 
    '''Request Message Body:'''
 
  
  
 +
'''Request Message Body:'''
  
 
{| style="border-spacing:0;"
 
{| style="border-spacing:0;"
Line 966: Line 963:
  
 
|}
 
|}
'''HTTP Response:'''
 
  
 +
 +
'''HTTP Response:'''
  
 
''Description:''
 
''Description:''
Line 985: Line 983:
  
 
|}
 
|}
    '''''Example:'''''
 
  
 +
 +
'''''Example:'''''
  
 
Request:
 
Request:
  
      GET<nowiki> <root-uri>/userService/</nowiki>usermanager/<nowiki><</nowiki>userName>/<nowiki><</nowiki>organizationName>
+
    GET<nowiki> <root-uri>/userService/</nowiki>usermanager/<nowiki><</nowiki>userName>/<nowiki><</nowiki>organizationName>
 
     Response:
 
     Response:
      HTTP/1.1 200 OK
+
    HTTP/1.1 200 OK
  
 
=== List users ===
 
=== List users ===
 
     <nowiki>GET <root-uri>/</nowiki>userService/usermanager/users/{organizationName}
 
     <nowiki>GET <root-uri>/</nowiki>userService/usermanager/users/{organizationName}
 
     Content-Type: application/json
 
     Content-Type: application/json
 +
  
 
'''Request Message Body:'''
 
'''Request Message Body:'''
 
 
  
 
{| style="border-spacing:0;"
 
{| style="border-spacing:0;"
Line 1,015: Line 1,013:
  
 
|}
 
|}
'''HTTP Response:'''
 
  
  
''Description:''
+
'''HTTP Response:'''
  
 +
''Description:''
  
 
{| style="border-spacing:0;"
 
{| style="border-spacing:0;"
Line 1,034: Line 1,032:
  
 
|}
 
|}
    '''''Example:'''''
 
  
 +
 +
'''''Example:'''''
  
 
Request:
 
Request:
  
      GET<nowiki> <root-uri>/userService/</nowiki>usermanager/usermanager
+
    GET<nowiki> <root-uri>/userService/</nowiki>usermanager/usermanager
    Response:
+
 
      HTTP/1.1 200 OK
+
Response:
      Content-Type: application/json
+
 
      {“users<nowiki>”:[</nowiki>“user1”,”user2”]}
+
    HTTP/1.1 200 OK
 +
    Content-Type: application/json
 +
    {“users<nowiki>”:[</nowiki>“user1”,”user2”]}
  
 
=== Delete user ===
 
=== Delete user ===
 
     <nowiki>DELETE <root-uri>/userService/usermanager/{userName}/{organizationName}</nowiki>
 
     <nowiki>DELETE <root-uri>/userService/usermanager/{userName}/{organizationName}</nowiki>
 
    '''Request Message Body:'''
 
  
  
 +
'''Request Message Body:'''
  
 
{| style="border-spacing:0;"
 
{| style="border-spacing:0;"
Line 1,071: Line 1,071:
  
 
|}
 
|}
'''HTTP Response:'''
 
  
  
''Description:''
 
  
 +
'''HTTP Response:'''
 +
 +
''Description:''
  
 
{| style="border-spacing:0;"
 
{| style="border-spacing:0;"
Line 1,094: Line 1,095:
  
 
|}
 
|}
    '''''Example:'''''
 
  
 +
 +
'''''Example:'''''
  
 
Request:
 
Request:
  
      DELETE<nowiki> <root-uri>/userService/</nowiki><nowiki>usermanager/<userName>/<organizationName></nowiki>
+
    DELETE<nowiki> <root-uri>/userService/</nowiki><nowiki>usermanager/<userName>/<organizationName></nowiki>
 
     Response:
 
     Response:
      200 DELETED
+
    200 DELETED
  
 
=== Delete all users ===
 
=== Delete all users ===
 
     <nowiki>DELETE <root-uri>/</nowiki>userService/usermanager/users/{organizationName}  
 
     <nowiki>DELETE <root-uri>/</nowiki>userService/usermanager/users/{organizationName}  
 
    '''Request Message Body:'''
 
  
  
 +
'''Request Message Body:'''
  
 
{| style="border-spacing:0;"
 
{| style="border-spacing:0;"
Line 1,123: Line 1,124:
  
 
|}
 
|}
'''HTTP Response:'''
 
  
  
''Description:''
+
'''HTTP Response:'''
  
 +
''Description:''
  
 
{| style="border-spacing:0;"
 
{| style="border-spacing:0;"
Line 1,142: Line 1,143:
  
 
|}
 
|}
    '''''Example:'''''
 
  
 +
 +
'''''Example:'''''
  
 
Request:
 
Request:
  
      DELETE<nowiki> <root-uri>/userService/</nowiki>usermanager/users/<nowiki><organization</nowiki>Name>  
+
    DELETE<nowiki> <root-uri>/userService/</nowiki>usermanager/users/<nowiki><organization</nowiki>Name>  
 
     Response:
 
     Response:
      200 DELETED
+
    200 DELETED
  
 
=== Assign/dismiss role ===
 
=== Assign/dismiss role ===
 
     <nowiki>PUT <root-uri>/</nowiki>userService/usermanager/roles/{username}/{organizationName}  
 
     <nowiki>PUT <root-uri>/</nowiki>userService/usermanager/roles/{username}/{organizationName}  
 
    '''Request Message Body:'''
 
  
  
 +
'''Request Message Body:'''
  
 
{| style="border-spacing:0;"
 
{| style="border-spacing:0;"
Line 1,183: Line 1,184:
  
 
|}
 
|}
'''HTTP Response:'''
 
  
  
''Description:''
+
'''HTTP Response:'''
  
 +
''Description:''
  
 
{| style="border-spacing:0;"
 
{| style="border-spacing:0;"
Line 1,202: Line 1,203:
  
 
|}
 
|}
    '''''Example:'''''
 
  
 +
 +
'''''Example:'''''
  
 
Request:
 
Request:
Line 1,210: Line 1,212:
 
       Content-Type: application/json
 
       Content-Type: application/json
 
       {“roleName”:”developer”}
 
       {“roleName”:”developer”}
    Response:
+
 
 +
 
 +
Response:
 +
 
 +
 
 
       HTTP/1.1 200 OK
 
       HTTP/1.1 200 OK
  
 
=== Assign/dismiss group ===
 
=== Assign/dismiss group ===
 
     <nowiki>PUT <root-uri>/</nowiki>userService/usermanager/groups/{username}
 
     <nowiki>PUT <root-uri>/</nowiki>userService/usermanager/groups/{username}
 
    '''Request Message Body:'''
 
  
  
 +
'''Request Message Body:'''
  
 
{| style="border-spacing:0;"
 
{| style="border-spacing:0;"
Line 1,239: Line 1,244:
  
 
|}
 
|}
'''HTTP Response:'''
 
  
 +
 +
'''HTTP Response:'''
  
 
''Description:''
 
''Description:''
Line 1,258: Line 1,264:
  
 
|}
 
|}
    '''''Example:'''''
 
  
 +
 +
'''''Example:'''''
  
 
Request:
 
Request:
Line 1,266: Line 1,273:
 
       Content-Type: application/json
 
       Content-Type: application/json
 
       {“groupName”:”developers”}  
 
       {“groupName”:”developers”}  
    Response:
+
 
 +
 
 +
Response:
 +
 
 
       HTTP/1.1 200 OK
 
       HTTP/1.1 200 OK
  
 
=== Get users with role ===
 
=== Get users with role ===
 
     <nowiki>GET <root-uri>/</nowiki>userService/usermanager/roles/{roleName}/{organizationName}  
 
     <nowiki>GET <root-uri>/</nowiki>userService/usermanager/roles/{roleName}/{organizationName}  
 
    '''Request Message Body:'''
 
  
  
 +
'''Request Message Body:'''
  
 
{| style="border-spacing:0;"
 
{| style="border-spacing:0;"
Line 1,295: Line 1,304:
  
 
|}
 
|}
'''HTTP Response:'''
 
  
 +
 +
'''HTTP Response:'''
  
 
''Description:''
 
''Description:''
Line 1,314: Line 1,324:
  
 
|}
 
|}
    '''''Example:'''''
 
  
 +
 +
'''''Example:'''''
  
 
Request:
 
Request:
  
      GET<nowiki> <root-uri>/userService/</nowiki>usermanager/roles/<nowiki><</nowiki>roleName>/<nowiki><organization</nowiki>Name>  
+
    GET<nowiki> <root-uri>/userService/</nowiki>usermanager/roles/<nowiki><</nowiki>roleName>/<nowiki><organization</nowiki>Name>  
     Response:
+
      
       HTTP/1.1 200 OK
+
 
 +
Response:
 +
        
 +
    HTTP/1.1 200 OK
  
 
=== Get users with group ===
 
=== Get users with group ===
 
     <nowiki>GET <root-uri>/</nowiki>userService/usermanager/groups/{groupName}/{organizationName}  
 
     <nowiki>GET <root-uri>/</nowiki>userService/usermanager/groups/{groupName}/{organizationName}  
 
    '''Request Message Body:'''
 
  
  
 +
'''Request Message Body:'''
  
 
{| style="border-spacing:0;"
 
{| style="border-spacing:0;"
Line 1,349: Line 1,362:
  
 
|}
 
|}
'''HTTP Response:'''
 
  
 +
 +
'''HTTP Response:'''
  
 
''Description:''
 
''Description:''
Line 1,368: Line 1,382:
  
 
|}
 
|}
    '''''Example:'''''
 
  
 +
 +
'''''Example:'''''
  
 
Request:
 
Request:
  
      GET<nowiki> <root-uri>/userService/</nowiki>usermanager/groups/<nowiki><</nowiki>groupName>/<nowiki><organization</nowiki>Name>  
+
    GET<nowiki> <root-uri>/userService/</nowiki>usermanager/groups/<nowiki><</nowiki>groupName>/<nowiki><organization</nowiki>Name>  
    Response:
+
   
      HTTP/1.1 200 OK
+
Response:
 +
 
 +
    HTTP/1.1 200 OK
  
 
=== Update credentials ===
 
=== Update credentials ===
 
     <nowiki>PUT <root-uri>/</nowiki>userService/usermanager/{username}/{organizationName}  
 
     <nowiki>PUT <root-uri>/</nowiki>userService/usermanager/{username}/{organizationName}  
  
    '''Request Message Body:'''
+
'''Request Message Body:'''
 
+
 
+
  
 
{| style="border-spacing:0;"
 
{| style="border-spacing:0;"
Line 1,415: Line 1,430:
  
 
|}
 
|}
'''HTTP Response:'''
 
  
 +
 +
'''HTTP Response:'''
  
 
''Description:''
 
''Description:''
Line 1,436: Line 1,452:
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"|  '''400 Bad Request '''
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"|  '''400 Bad Request '''
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"|  Invalid parameter or field names in the request.
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"|  Invalid parameter or field names in the request.
 
 
 
 
|}
 
|}
    '''''Example:'''''
 
  
 +
 +
'''''Example:'''''
  
 
Request:
 
Request:
  
 
       PUT<nowiki> <root-uri>/userService/</nowiki>usermanager/<nowiki><</nowiki>username>/<nowiki><</nowiki>organizationName>
 
       PUT<nowiki> <root-uri>/userService/</nowiki>usermanager/<nowiki><</nowiki>username>/<nowiki><</nowiki>organizationName>
    Response:
+
 
 +
 
 +
Response:
 +
 
 
       200 UPDATED
 
       200 UPDATED

Latest revision as of 16:20, 25 July 2013

Organization Management

Create organization

    PUT <root-uri>/userService/organizationmanager/{organizationName} 

Request Message Body:

Name
Type
Description
mandatory/optional
organizationName
JSON String
Name of the organization
mandatory


HTTP Response:

Description:

HTTP Status Description
200 Created organization was created
400 Bad Request Invalid parameter or field names in the request.



Example:

Request:

    PUT <root-uri>/userService/organizationmanager/<organizationName> 
    Response:
    200 CREATED

Get organization

    GET <root-uri>/userService/organizationmanager/{organizationName} 
    Request Message Body:


Name
Type
Description
mandatory/optional
organizationName
JSON String
Name of the organization
mandatory


HTTP Response:

Description:

HTTP Status Description
HTTP/1.1 200 OK Organization was present already
404 Not Found Organization was not present


Example:

Request:

    GET <root-uri>/userService/organizationmanager/<organizationName> 
    Response:
    HTTP/1.1 200 OK

Delete organization

    DELETE <root-uri>/userService/organizationmanager/{organizationName} 

Request Message Body:

Name
Type
Description
mandatory/optional
organizationName
JSON String
Name of the organization
mandatory


HTTP Response:

Description:

HTTP Status Description
HTTP/1.1 200 OK organization was successfully deleted
404 Not Found Organization was not found
400 Bad Request Invalid parameter of field names in the request


Example:

Request:

    DELETE <root-uri>/userService/organizationmanager/<organizationName> 
    Response:
    200 DELETED

List organizations

    GET <root-uri>/userService/organizationmanager/organizations
    Content-Type: application/json


HTTP Response:

Description:


HTTP Status Description
HTTP/1.1 200 OK There was at least one organization
404 Not Found No organization was present


Example:

Request:

    GET <root-uri>/userService/organizationmanager/organizations
    Response:
    HTTP/1.1 200 OK
    Content-Type: application/json
    {“organizations”:[
     {“name”:“engineering”,”description”:”www.eng.it”},
     {“name”:”venus-c”,”description”:”www.venus-c.eu”}
    ]}

Delete organizations

    DELETE <root-uri>/userService/organizationmanager/organizations


HTTP Response:

Description:

HTTP Status Description
HTTP/1.1 200 OK organizations have been successfully deleted
404 Not Found No organization was present


Example:

Request:

     DELETE <root-uri>/userService/organizationmanager/organizations
    Response:
    HTTP/1.1 200 OK

Group Management

Create group

    PUT <root-uri>/userService/groupmanager/


Request Message Body:

Name
Type
Description
mandatory/optional
groupName
JSON String
Name of the group
mandatory
organizationName
JSON String
Organization of the user
optional
description
JSON String
Group description
optional

HTTP Response:

Description:


HTTP Status Description
200 Created group was created
400 Bad Request Invalid parameter or field names in the request.

Example:

Request:

     PUT <root-uri>/userService/groupmanager/
    Content-Type: application/json
    {“groupName” : “itpeople”}
    Response:
    HTTP/1.1 200 CREATED

Get group by group name

    GET <root-uri>/userService/groupmanager/{groupName} 


Request Message Body:

Name
Type
Description
mandatory/optional
groupName
JSON String
Name of the group
mandatory


HTTP Response:

Description:


HTTP Status Description
HTTP/1.1 200 OK Group was present already
404 Not Found Group was not present

Example:

Request:

    GET <root-uri>/userService/groupmamager/<groupName> 
    Response:
    HTTP/1.1 200 OK

Get group by group name and organization name

GET <root-uri>/userService/groupmanager/{groupName}/organization/{organizationName}


Request Message Body:

Name
Type
Description
mandatory/optional
groupName
JSON String
Name of the group
mandatory
organizationName
JSON String
Name of the organization
mandatory


HTTP Response:

Description:


HTTP Status Description
HTTP/1.1 200 OK Group was present already
404 Not Found Group was not present


Example:

Request:

  GET <root-uri>/userService/groupmamager/<groupName>/organization/<organizationName>
  Response:
  HTTP/1.1 200 OK

List groups

    GET <root-uri>/userService/groupmanager/groups/{organizationName}
    Content-Type: application/json


Request Message Body:

Name
Type
Description
mandatory/optional
organizationName
JSON String
Name of the organization
optional


HTTP Response:

Description:

HTTP Status Description
HTTP/1.1 200 OK There was at least one group
404 Not Found No group was present


Example:

Request:

    GET <root-uri>/userService/groupmanager/groups
    Response:
    HTTP/1.1 200 OK
    Content-Type: application/json
    {“groups”:[“itpeople”,”admins”]}

Delete group

    DELETE <root-uri>/userService/groupmanager/{groupName}/{organizationName} 


Request Message Body:

Name
Type
Description
mandatory/optional
groupName
JSON String
Name of the group
mandatory
organizationName
JSON String
Name of the organization
optional


HTTP Response:

Description:


HTTP Status Description
HTTP/1.1 200 OK group was successfully deleted
400 Bad Request Invalid parameter of field names in the request


Example:

Request:

    DELETE <root-uri>/userService/groupmanager/<groupName>/<organizationName> 
    Response:
    200 DELETED

Delete all groups

    DELETE <root-uri>/userService/groupmanager/groups/{organizationName} 


Request Message Body:

Name
Type
Description
mandatory/optional
organizationName
JSON String
Name of the organization
optional


HTTP Response:

Description:


HTTP Status Description
HTTP/1.1 200 OK Groups have been successfully deleted
400 Bad Request Invalid parameter of field names in the request


Example:

Request:

    DELETE <root-uri>/userService/groupmanager/groups/<organizationName> 
    Response:
    200 DELETED

Update group

    POST <root-uri>/userService/groupmanager


Request Message Body:

Name
Type
Description
mandatory/optional
groupName
JSON String
Name of the group
mandatory
organizationName
JSON String
Organization of the user
optional
description
JSON String
Group description
optional


HTTP Response:

Description:

HTTP Status Description
HTTP/1.1 200 OK Groups have been successfully updated
304 Not Modified Invalid parameter of field names in the request


Example:

Request:

    POST <root-uri>/userService/groupmanager
    Response:
    200 UPDATED

Role Management

Create role

    PUT <root-uri>/userService/rolemanager/{organizationName}


Request Message Body:

Name
Type
Description
mandatory/optional
organizationName
JSON String
Name of the organization
optional
roleName
JSON String
Name of the group
mandatory


HTTP Response:

Description:

HTTP Status Description
200 Created role was created
400 Bad Request Invalid parameter or field names in the request.


Example:

Request:

     PUT <root-uri>/userService/rolemanager/
    Content-Type: application/json
    {“roleName” : “admin”}


Response:

     HTTP/1.1 200 CREATED

List roles

    GET <root-uri>/userService/rolemanager/roles/{organizationName} 


Request Message Body:

Name
Type
Description
mandatory/optional
organizationName
JSON String
Name of the organization
optional


HTTP Response:

Description:

HTTP Status Description
HTTP/1.1 200 OK There was at least one role
404 Not Found No role is present


Example:

Request:

    GET <root-uri>/userService/organizationmanager/<organizationName> 
    Response:
    HTTP/1.1 200 OK

Get roles of user

    GET <root-uri>/userService/rolemanager/users/{userName}/{organizationName} 

Request Message Body:

Name
Type
Description
mandatory/optional
UserName
JSON String
Name of the user
mandatory
organizationName
JSON String
Name of the organization
optional


HTTP Response:

Description:

HTTP Status Description
HTTP/1.1 200 OK User is present
404 Not Found User is not present


Example:

Request:

    GET <root-uri>/userService/rolemanager/users/<username>/<organizationName> 


Response:

    HTTP/1.1 200 OK

User Management

Create user

    PUT <root-uri>/userService/usermanager/
   Host:cloud.example.com
  Content-Type: application/json
  {"username":"newUser",
   "firstname":"ggg",
   "lastname":"ggg",
  "password":"ggg"}


Request Message Body:

Name
Type
Description
mandatory/optional
username JSON String name of the user mandatory
firstname JSON String firstname of the user mandatory
lastname JSON String lastname of the user mandatory
password JSON String user chosen password mandatory
organizationName JSON String Organization of the user optional
certificate JSON String X509 Distinguished Name optional


HTTP Response:

Description:

HTTP Status Description
200 Created User was created
400 Bad Request Invalid parameter or field names in the request.


Example:

Request:

     PUT <root-uri>/userService/usermanager/
    Response:
    200 CREATED

Update user

    PUT <root-uri>/userService/usermanager/update
     Host:cloud.example.com
    Content-Type: application/json
    {"username":"user1",
     "firstname":"ggg1",
     "lastname":"ggg2",


Request Message Body:

Name
Type
Description
mandatory/optional
username JSON String name of the user mandatory
firstname JSON String firstname of the user optional
lastname JSON String lastname of the user optional
password JSON String user chosen password optional
organizationName JSON String Organization of the user optional
certificate JSON String X509 Distinguished Name optional

HTTP Response:


Description:


HTTP Status Description
200 Created User was updated
304 Not Modified User was not updated.


Example:

Request:

     PUT <root-uri>/userService/usermanager/update
    Response:
    200 CREATED

Get user

    GET <root-uri>/userService/usermanager/{userName}/{organizationName}


Request Message Body:

Name
Type
Description
mandatory/optional
userName
JSON String
Name of the user
mandatory
organizationName
JSON String
Name of the organization
optional


HTTP Response:

Description:


HTTP Status Description
HTTP/1.1 200 OK User was present already
404 Not Found User was not present


Example:

Request:

    GET <root-uri>/userService/usermanager/<userName>/<organizationName>
    Response:
    HTTP/1.1 200 OK

List users

    GET <root-uri>/userService/usermanager/users/{organizationName}
    Content-Type: application/json


Request Message Body:

Name
Type
Description
mandatory/optional
organizationName
JSON String
Name of the organization
optional


HTTP Response:

Description:

HTTP Status Description
HTTP/1.1 200 OK There was at least one user
404 Not Found No user was present


Example:

Request:

    GET <root-uri>/userService/usermanager/usermanager

Response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    {“users”:[“user1”,”user2”]}

Delete user

    DELETE <root-uri>/userService/usermanager/{userName}/{organizationName}


Request Message Body:

Name
Type
Description
mandatory/optional
userName
JSON String
Name of the user
mandatory
organizationName
JSON String
Name of the organization
optional


HTTP Response:

Description:

HTTP Status Description
HTTP/1.1 200 OK user was successfully deleted
404 Not Found user was not found
400 Bad Request Invalid parameter of field names in the request


Example:

Request:

    DELETE <root-uri>/userService/usermanager/<userName>/<organizationName>
    Response:
    200 DELETED

Delete all users

    DELETE <root-uri>/userService/usermanager/users/{organizationName} 


Request Message Body:

Name
Type
Description
mandatory/optional
organizationName
JSON String
Name of the organization
optional


HTTP Response:

Description:

HTTP Status Description
HTTP/1.1 200 OK Users have been successfully deleted
400 Bad Request Invalid parameter of field names in the request


Example:

Request:

    DELETE <root-uri>/userService/usermanager/users/<organizationName> 
    Response:
    200 DELETED

Assign/dismiss role

    PUT <root-uri>/userService/usermanager/roles/{username}/{organizationName} 


Request Message Body:

Name
Type
Description
mandatory/optional
roleName
JSON String
Name of the role
mandatory
userName
JSON String
Name of the user
mandatory
organizationName
JSON String
Name of the organization
optional


HTTP Response:

Description:

HTTP Status Description
HTTP/1.1 200 OK Role was successfully assigned/dismissed
304 Not Modified Invalid parameter of field names in the request


Example:

Request:

     PUT <root-uri>/userService/usermanager/roles/<userName>/<organizationName> 
     Content-Type: application/json
     {“roleName”:”developer”}


Response:


     HTTP/1.1 200 OK

Assign/dismiss group

    PUT <root-uri>/userService/usermanager/groups/{username}


Request Message Body:

Name
Type
Description
mandatory/optional
groupName
JSON String
Name of the group
mandatory
userName
JSON String
Name of the user
mandatory


HTTP Response:

Description:


HTTP Status Description
HTTP/1.1 200 OK Group was successfully assigned/dismissed
304 Not Modified Invalid parameter of field names in the request


Example:

Request:

     PUT <root-uri>/userService/usermanager/groups/<userName>
     Content-Type: application/json
     {“groupName”:”developers”} 


Response:

     HTTP/1.1 200 OK

Get users with role

    GET <root-uri>/userService/usermanager/roles/{roleName}/{organizationName} 


Request Message Body:

Name
Type
Description
mandatory/optional
roleName
JSON String
Name of the role
mandatory
organizationName
JSON String
Name of the organization
optional


HTTP Response:

Description:


HTTP Status Description
HTTP/1.1 200 OK There was at least one user
404 Not Found No user was present


Example:

Request:

    GET <root-uri>/userService/usermanager/roles/<roleName>/<organizationName> 
    

Response:

    HTTP/1.1 200 OK

Get users with group

    GET <root-uri>/userService/usermanager/groups/{groupName}/{organizationName} 


Request Message Body:

Name
Type
Description
mandatory/optional
groupName
JSON String
Name of the group
mandatory
organizationName
JSON String
Name of the organization
optional


HTTP Response:

Description:


HTTP Status Description
HTTP/1.1 200 OK There was at least one user
404 Not Found No user was present


Example:

Request:

    GET <root-uri>/userService/usermanager/groups/<groupName>/<organizationName> 
   

Response:

    HTTP/1.1 200 OK

Update credentials

    PUT <root-uri>/userService/usermanager/{username}/{organizationName} 

Request Message Body:

Name
Type
Description
mandatory/optional
oldPassword
JSON String
Old password
mandatory
newPassword
JSON String
New password
mandatory
userName
JSON String
Name of the user
mandatory
organizationName
JSON String
Name of the organization
optional


HTTP Response:

Description:


HTTP Status Description
HTTP/1.1 200 OK Credentials have been successfully updated
401 Unauthorized Provided credentials were wrong
400 Bad Request Invalid parameter or field names in the request.


Example:

Request:

     PUT <root-uri>/userService/usermanager/<username>/<organizationName>


Response:

     200 UPDATED