Skip to content

user management API TAP 2016 APR 1

mlaboszc edited this page Apr 21, 2016 · 2 revisions

Overview

Api endpoints for managing users, organizations and spaces in TAP

Contact information

License information

License: Apache License Version 2.0 License URL: https://github.com/trustedanalytics/user-management/blob/master/LICENSE.txt

URI scheme

Host: user-management.domain BasePath: /

Tags

  • authorization-controller: Authorization Controller
  • current-user-controller: Current User Controller
  • users-controller: Users Controller
  • spaces-controller: Spaces Controller
  • orgs-controller: Orgs Controller
  • registrations-controller: Registrations Controller
  • invitations-controller: Invitations Controller

Paths

Get pending invitations.

GET /rest/invitations

Responses

HTTP Code Description Schema
200 OK string array
500 Internal server error, e.g. error connecting to CloudController No Content

Consumes

  • application/json

Produces

  • /

Tags

  • invitations-controller

Add a new invitation for email.

POST /rest/invitations

Parameters

Type Name Description Required Schema Default
BodyParameter invitation invitation true InvitationModel

Responses

HTTP Code Description Schema
200 OK ErrorDescriptionModel
409 Invalid email format. No Content
500 Internal server error, e.g. error connecting to CloudController No Content

Consumes

  • application/json

Produces

  • /

Tags

  • invitations-controller

Delete an invitation.

DELETE /rest/invitations/{email}

Parameters

Type Name Description Required Schema Default
PathParameter email email true string

Responses

HTTP Code Description Schema
200 OK No Content
404 Invitation not found. No Content
500 Internal server error, e.g. error connecting to CloudController No Content

Consumes

  • application/json

Produces

  • /

Tags

  • invitations-controller

Resend invitation to the email.

POST /rest/invitations/{email}/resend

Parameters

Type Name Description Required Schema Default
PathParameter email email true string

Responses

HTTP Code Description Schema
200 OK No Content
404 Invitation not found. No Content
500 Internal server error, e.g. error connecting to CloudController No Content

Consumes

  • application/json

Produces

  • /

Tags

  • invitations-controller

Returns list of organizations.

GET /rest/orgs

Responses

HTTP Code Description Schema
200 OK Organization array
500 Internal server error, e.g. error connecting to CloudController No Content

Consumes

  • application/json

Produces

  • application/json

Tags

  • orgs-controller

Creates a new organization.

POST /rest/orgs

Parameters

Type Name Description Required Schema Default
BodyParameter request request true OrgNameRequest

Responses

HTTP Code Description Schema
200 OK string
500 Internal server error, e.g. error connecting to CloudController No Content

Consumes

  • application/json

Produces

  • /

Tags

  • orgs-controller

Returns permissions for user within specified organizations.

GET /rest/orgs/permissions

Parameters

Type Name Description Required Schema Default
QueryParameter orgs orgs false string

Responses

HTTP Code Description Schema
200 OK CcOrgPermission array
500 Internal server error, e.g. error connecting to CloudController No Content

Consumes

  • application/json

Produces

  • /

Tags

  • authorization-controller

Deletes organization.

DELETE /rest/orgs/{org}

Parameters

Type Name Description Required Schema Default
PathParameter org org true string

Responses

HTTP Code Description Schema
200 OK No Content
404 Organization not found. No Content
500 Internal server error, e.g. error connecting to CloudController No Content

Consumes

  • application/json

Produces

  • /

Tags

  • orgs-controller

Renames organization name.

PUT /rest/orgs/{org}/name

Parameters

Type Name Description Required Schema Default
BodyParameter request request true OrgNameRequest
PathParameter org org true string

Responses

HTTP Code Description Schema
200 OK No Content
400 The organization name is already taken No Content
500 Internal server error, e.g. error connecting to CloudController No Content

Consumes

  • application/json

Produces

  • /

Tags

  • orgs-controller

Getting a list of spaces of given organization

GET /rest/orgs/{org}/spaces

Parameters

Type Name Description Required Schema Default
PathParameter org org true string

Responses

HTTP Code Description Schema
200 OK CcSpace array
500 Internal server error, e.g. error connecting to CloudController No Content

Consumes

  • application/json

Produces

  • application/json

Tags

  • spaces-controller

Returns list of users which has at least one role in the organization. NOTE: The CF role 'Users' is not included

GET /rest/orgs/{org}/users

Parameters

Type Name Description Required Schema Default
PathParameter org org true string

Responses

HTTP Code Description Schema
200 OK User array
400 Request was malformed. eg. 'org' is not a valid UUID or organization withID 'org' doesn't exist No Content
500 Internal server error, e.g. error connecting to CloudController No Content

Consumes

  • application/json

Produces

  • application/json

Tags

  • users-controller

Sends invitations message for new users or returns user for existing one in organization.

POST /rest/orgs/{org}/users

Parameters

Type Name Description Required Schema Default
BodyParameter userRequest userRequest true UserRequest
PathParameter org org true string

Responses

HTTP Code Description Schema
200 OK User
400 Request was malformed. eg. 'org' is not a valid UUID or organization withID 'org' doesn't exist No Content
409 Email is not valid or it belongs to forbidden domains. No Content
500 Internal server error, e.g. error connecting to CloudController No Content

Consumes

  • application/json

Produces

  • application/json

Tags

  • users-controller

Deletes user from organization.

DELETE /rest/orgs/{org}/users/{user}

Parameters

Type Name Description Required Schema Default
PathParameter org org true string
PathParameter user user true string

Responses

HTTP Code Description Schema
200 OK No Content
400 Request was malformed. eg. 'org' is not a valid UUID or organization withID 'org' doesn't exist No Content
404 User 'user' not found in organization. No Content
500 Internal server error, e.g. error connecting to CloudController No Content

Consumes

  • application/json

Produces

  • /

Tags

  • users-controller

Updates user roles in organization

POST /rest/orgs/{org}/users/{user}

Parameters

Type Name Description Required Schema Default
BodyParameter userRolesRequest userRolesRequest true UserRolesRequest
PathParameter org org true string
PathParameter user user true string

Responses

HTTP Code Description Schema
200 OK enum (managers, billing_managers, auditors, developers, users) array
400 Request was malformed. eg. 'org' is not a valid UUID or organization withID 'org' doesn't exist No Content
404 User not found in organization. No Content
409 Roles should be specified. No Content
500 Internal server error, e.g. error connecting to CloudController No Content

Consumes

  • application/json

Produces

  • application/json

Tags

  • users-controller

Registers new user using security code received in email message.

POST /rest/registrations

Parameters

Type Name Description Required Schema Default
BodyParameter newUser newUser true RegistrationModel
QueryParameter code code false string

Responses

HTTP Code Description Schema
200 OK RegistrationModel
400 Invalid organization name. No Content
403 Security code 'code' empty or null No Content
409 Invalid password (empty or too short). No Content
500 Internal server error, e.g. error connecting to CloudController No Content

Consumes

  • application/json

Produces

  • /

Tags

  • registrations-controller

Gets invitation using security code received in email message.

GET /rest/registrations/{code}

Parameters

Type Name Description Required Schema Default
PathParameter code code true string

Responses

HTTP Code Description Schema
200 OK InvitationModel
403 Security code 'code' empty or null No Content
500 Internal server error, e.g. error connecting to CloudController No Content

Consumes

  • application/json

Produces

  • /

Tags

  • registrations-controller

Returns list of spaces.

GET /rest/spaces

Responses

HTTP Code Description Schema
200 OK CcSpace array
500 Internal server error, e.g. error connecting to CloudController No Content

Consumes

  • application/json

Produces

  • application/json

Tags

  • spaces-controller

Creates a new space in organization

POST /rest/spaces

Parameters

Type Name Description Required Schema Default
BodyParameter request request true NewSpaceRequest

Responses

HTTP Code Description Schema
200 OK string
400 Bad request No Content
500 Internal server error, e.g. error connecting to CloudController No Content

Consumes

  • application/json

Produces

  • /

Tags

  • spaces-controller

Deletes space.

DELETE /rest/spaces/{space}

Parameters

Type Name Description Required Schema Default
PathParameter space space true string

Responses

HTTP Code Description Schema
200 OK No Content
404 Space not found. No Content
500 Internal server error, e.g. error connecting to CloudController No Content

Consumes

  • application/json

Produces

  • /

Tags

  • spaces-controller

Returns all users with given role within space identified by given GUID

GET /rest/spaces/{space}/users

Parameters

Type Name Description Required Schema Default
PathParameter space space true string
QueryParameter username username false ref

Responses

HTTP Code Description Schema
200 OK User array
400 Request was malformed. eg. 'space' is not a valid UUID or space withID 'space' doesn't exist No Content
500 Internal server error, e.g. error connecting to CloudController No Content

Consumes

  • application/json

Produces

  • application/json

Tags

  • users-controller

Sends invitations message for new users or returns user for existing one in space.

POST /rest/spaces/{space}/users

Parameters

Type Name Description Required Schema Default
BodyParameter userRequest userRequest true UserRequest
PathParameter space space true string

Responses

HTTP Code Description Schema
200 OK User
400 Request was malformed. eg. 'space' is not a valid UUID or space withID 'space' doesn't exist No Content
409 Email is not valid or it belongs to forbidden domains. No Content
500 Internal server error, e.g. error connecting to CloudController No Content

Consumes

  • application/json

Produces

  • application/json

Tags

  • users-controller

Deletes user from space.

DELETE /rest/spaces/{space}/users/{user}

Parameters

Type Name Description Required Schema Default
PathParameter space space true string
PathParameter user user true string

Responses

HTTP Code Description Schema
200 OK No Content
400 Request was malformed. eg. 'space' is not a valid UUID or space withID 'space' doesn't exist No Content
404 User 'user' not found in space. No Content
500 Internal server error, e.g. error connecting to CloudController No Content

Consumes

  • application/json

Produces

  • /

Tags

  • users-controller

Updates user roles in space

POST /rest/spaces/{space}/users/{user}

Parameters

Type Name Description Required Schema Default
BodyParameter userRolesRequest userRolesRequest true UserRolesRequest
PathParameter space space true string
PathParameter user user true string

Responses

HTTP Code Description Schema
200 OK enum (managers, billing_managers, auditors, developers, users) array
400 Request was malformed. eg. 'space' is not a valid UUID or space withID 'space' doesn't exist No Content
404 User not found in space. No Content
409 User must have at least one role. No Content
500 Internal server error, e.g. error connecting to CloudController No Content

Consumes

  • application/json

Produces

  • application/json

Tags

  • users-controller

Returns current user.

GET /rest/users/current

Responses

HTTP Code Description Schema
200 OK UserModel
500 Internal server error, e.g. error connecting to CloudController No Content

Consumes

  • application/json

Produces

  • /

Tags

  • current-user-controller

Changes password for current user.

PUT /rest/users/current/password

Parameters

Type Name Description Required Schema Default
BodyParameter request request true ChangePasswordRequest

Responses

HTTP Code Description Schema
200 OK UserModel
400 Password cannot be empty No Content
409 Password too short No Content
500 Internal server error, e.g. error connecting to CloudController No Content

Consumes

  • application/json

Produces

  • application/json

Tags

  • current-user-controller

Definitions

CcMetadata

Name Description Required Schema Default
guid false string

CcOrg

Name Description Required Schema Default
entity false CcOrgEntity
metadata false CcMetadata

CcOrgEntity

Name Description Required Schema Default
name false string
status false string

CcOrgPermission

Name Description Required Schema Default
auditor false boolean
billingManager false boolean
manager false boolean
organization false CcOrg

CcSpace

Name Description Required Schema Default
entity false CcSpaceEntity
metadata false CcMetadata

CcSpaceEntity

Name Description Required Schema Default
name false string
organization_guid false string

ChangePasswordRequest

Name Description Required Schema Default
oldPassword false string
password false string

Collection??CcOrgPermission??

Name Description Required Schema Default
empty false boolean

Collection??CcSpace??

Name Description Required Schema Default
empty false boolean

Collection??Organization??

Name Description Required Schema Default
empty false boolean

Collection??Space??

Name Description Required Schema Default
empty false boolean

Collection??User??

Name Description Required Schema Default
empty false boolean

ErrorDescriptionModel

Name Description Required Schema Default
details false string
state false enum (NEW, UPDATED, ERROR)

InvitationModel

Name Description Required Schema Default
eligibleToCreateOrg false boolean
email false string

NewSpaceRequest

Name Description Required Schema Default
name false string
org_guid false string

OrgNameRequest

Name Description Required Schema Default
name false string

Organization

Name Description Required Schema Default
guid false string
manager false boolean
name false string
spaces false Collection??Space??

RegistrationModel

Name Description Required Schema Default
org false string
password false string

Space

Name Description Required Schema Default
guid false string
name false string

User

Name Description Required Schema Default
guid false string
org_guid false string
roles false enum (managers, billing_managers, auditors, developers, users) array
username false string

UserModel

Name Description Required Schema Default
email false string
org false string
role false enum (ADMIN, USER)

UserRequest

Name Description Required Schema Default
org_guid false string
roles false enum (managers, billing_managers, auditors, developers, users) array
username false string

UserRolesRequest

Name Description Required Schema Default
roles false enum (managers, billing_managers, auditors, developers, users) array
Clone this wiki locally