Created
March 25, 2016 09:28
-
-
Save seriousme/3c39eb5ed029cb02d602 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"swagger": "2.0", | |
"info": { | |
"description": "Testlab user account api.", | |
"version": "1.0.0", | |
"title": "Testlab user account", | |
"termsOfService": "http://labmgmt.testlab.local/terms/", | |
"contact": { | |
"name": "Testlab Team", | |
"email": "[email protected]" | |
}, | |
"license": { | |
"name": "Apache 2.0", | |
"url": "http://www.apache.org/licenses/LICENSE-2.0.html" | |
} | |
}, | |
"host": "labmgmt.testlab.local:8080", | |
"basePath": "/api/v1", | |
"schemes": [ | |
"http" | |
], | |
"consumes": [ | |
"application/json" | |
], | |
"produces": [ | |
"application/json" | |
], | |
"paths": { | |
"/groups": { | |
"get": { | |
"summary": "Get list of groups", | |
"description": "", | |
"operationId": "getGroups", | |
"responses": { | |
"200": { | |
"description": "Successful operation", | |
"schema": { | |
"$ref": "#/definitions/Groups" | |
} | |
}, | |
"default": { | |
"description": "unexpected error", | |
"schema": { | |
"$ref": "#/definitions/errorModel" | |
} | |
} | |
} | |
} | |
}, | |
"/users": { | |
"post": { | |
"description": "Create a user in AD", | |
"operationId": "createaduser", | |
"parameters": [ | |
{ | |
"in": "body", | |
"name": "body", | |
"required": true, | |
"schema": { | |
"$ref": "#/definitions/User" | |
} | |
} | |
], | |
"responses": { | |
"200": { | |
"description": "Successful operation" | |
}, | |
"default": { | |
"description": "unexpected error", | |
"schema": { | |
"$ref": "#/definitions/errorModel" | |
} | |
} | |
} | |
} | |
}, | |
"/users/{userName}": { | |
"get": { | |
"description": "Check account name in active directory", | |
"operationId": "userNameExists", | |
"parameters": [ | |
{ | |
"name": "userName", | |
"in": "path", | |
"required": true, | |
"type": "string" | |
}, | |
{ | |
"name": "euAccount", | |
"in": "query", | |
"description": "Is this an EU account ?", | |
"required": true, | |
"type": "boolean" | |
} | |
], | |
"responses": { | |
"200": { | |
"description": "successful operation", | |
"schema": { | |
"$ref": "#/definitions/Exists" | |
} | |
}, | |
"default": { | |
"description": "unexpected error", | |
"schema": { | |
"$ref": "#/definitions/errorModel" | |
} | |
} | |
} | |
} | |
} | |
}, | |
"definitions": { | |
"Groups": { | |
"type": "array", | |
"items": { | |
"type": "string" | |
} | |
}, | |
"Exists": { | |
"type": "boolean" | |
}, | |
"User": { | |
"type": "object", | |
"required": [ | |
"adGroup", | |
"displayName", | |
"emailAddress", | |
"firstName", | |
"initials", | |
"lastName", | |
"userName" | |
], | |
"properties": { | |
"userName": { | |
"type": "string", | |
"description": "The user name", | |
"example": "user1" | |
}, | |
"displayName": { | |
"type": "string", | |
"description": "The display name", | |
"example": "User 1" | |
}, | |
"emailAddress": { | |
"type": "string", | |
"description": "The email address", | |
"pattern": "^[A-Z0-9._%+-]+@[A-Z0-9._%+-]+\\\\.[A-Z]{2,4}$", | |
"example": "[email protected]" | |
}, | |
"firstName": { | |
"type": "string", | |
"description": "The first name" | |
}, | |
"lastName": { | |
"type": "string", | |
"description": "The last name" | |
}, | |
"initials": { | |
"type": "string", | |
"description": "The initials" | |
}, | |
"adGroup": { | |
"type": "string", | |
"description": "The Active Directory group" | |
}, | |
"isEuAccount": { | |
"type": "boolean", | |
"description": "Is this an EU account ?" | |
} | |
} | |
}, | |
"errorModel": { | |
"type": "object", | |
"required": [ | |
"code", | |
"message" | |
], | |
"properties": { | |
"code": { | |
"type": "integer", | |
"format": "int32" | |
}, | |
"message": { | |
"type": "string" | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment