Skip to content

Instantly share code, notes, and snippets.

@marbemac
Created October 18, 2016 16:18
Show Gist options
  • Save marbemac/ab5db4fba6405ee06912ed6e4ffffdfc to your computer and use it in GitHub Desktop.
Save marbemac/ab5db4fba6405ee06912ed6e4ffffdfc to your computer and use it in GitHub Desktop.
swagger: '2.0'
info:
version: 0.2.0
title: VMware Cello
description: RESTful API for VMware Cello User Service
termsOfService: 'https://github.com/vmware/cello/blob/master/LICENSE'
license:
name: Apache 2.0
url: 'https://github.com/vmware/cello/blob/master/LICENSE'
contact:
name: VMware Cello Team
url: 'https://github.com/vmware/cello'
host: '0.0.0.0:64637'
basePath: /v1
parameters:
requestId:
name: X-Request-Id
in: header
type: string
responses:
errorResponse:
description: Error
schema:
$ref: '#/definitions/error'
noContentResponse:
description: No Content
schemes:
- http
- https
consumes:
- application/json
- application/vnd.vmware.cello.v1+json
produces:
- application/vnd.vmware.cello.v1+json
paths:
/users:
parameters:
- $ref: "#/parameters/requestId"
get:
description: list users
operationId: list
tags:
- userlist
responses:
'200':
description: a list of users
schema:
type: array
items:
$ref: "#/definitions/userOut"
'500':
description: server error
schema:
$ref: "#/definitions/error"
'501':
description: not implemented
schema:
$ref: "#/definitions/error"
default:
$ref: "#/responses/errorResponse"
/user:
parameters:
- $ref: "#/parameters/requestId"
post:
description: create a user
operationId: create
tags:
- userservice
parameters:
- name: userIn
in: body
schema:
$ref: '#/definitions/userIn'
required: true
responses:
'201':
description: a single user response
schema:
$ref: "#/definitions/userOut"
'400':
description: bad request
schema:
$ref: "#/definitions/error"
'403':
description: permission denied
schema:
$ref: "#/definitions/error"
'409':
description: user already exists
schema:
$ref: "#/definitions/error"
'500':
description: server error
schema:
$ref: "#/definitions/error"
default:
$ref: "#/responses/errorResponse"
put:
description: update user information
operationId: update
tags:
- userservice
parameters:
- name: userIn
in: body
schema:
$ref: '#/definitions/userIn'
required: true
responses:
'200':
description: a single user response
schema:
$ref: "#/definitions/userOut"
'400':
description: bad update request
schema:
$ref: "#/definitions/error"
'403':
description: cannot complete request
schema:
$ref: "#/definitions/error"
'404':
description: user not found
schema:
$ref: "#/definitions/error"
'500':
description: server error
schema:
$ref: "#/definitions/error"
default:
$ref: "#/responses/errorResponse"
delete:
description: delete a user
operationId: delete
tags:
- userservice
parameters:
- name: userDel
in: body
schema:
$ref: "#/definitions/userDel"
required: true
responses:
'204':
$ref: "#/responses/noContentResponse"
'400':
description: bad update request
schema:
$ref: "#/definitions/error"
'403':
description: cannot complete request
schema:
$ref: "#/definitions/error"
'404':
description: user not found
schema:
$ref: "#/definitions/error"
'409':
description: user is in a state not for deletion
schema:
$ref: "#/definitions/error"
'500':
description: server error
schema:
$ref: "#/definitions/error"
default:
$ref: "#/responses/errorResponse"
/user/{encodedEmail}:
parameters:
- $ref: "#/parameters/requestId"
- name: encodedEmail
description: user email encoded, base64.RawURLEncoding
in: path
type: string
required: true
get:
description: get user information
operationId: get
tags:
- userservice
responses:
'200':
description: a single extended user response
schema:
$ref: "#/definitions/userOut"
'400':
description: bad get request
schema:
$ref: "#/definitions/error"
'403':
description: cannot complete request
schema:
$ref: "#/definitions/error"
'404':
description: user not found
schema:
$ref: "#/definitions/error"
'500':
description: server error
schema:
$ref: "#/definitions/error"
default:
$ref: "#/responses/errorResponse"
/user/login:
parameters:
- $ref: "#/parameters/requestId"
post:
description: authenticate/authorize user
operationId: login
tags:
- userservice
parameters:
- name: authInfo
in: body
schema:
$ref: "#/definitions/authInfo"
required: true
responses:
'200':
description: a single user response
schema:
$ref: "#/definitions/tokens"
'400':
description: bad update request
schema:
$ref: "#/definitions/error"
'403':
description: cannot complete request
schema:
$ref: "#/definitions/error"
'404':
description: user not found
schema:
$ref: "#/definitions/error"
'500':
description: server error
schema:
$ref: "#/definitions/error"
default:
$ref: "#/responses/errorResponse"
/user/refresh:
parameters:
- $ref: "#/parameters/requestId"
post:
description: refresh user authentication
operationId: refresh
tags:
- userservice
parameters:
- name: refreshInfo
in: body
schema:
$ref: '#/definitions/refreshInfo'
required: true
responses:
'200':
description: a single user response
schema:
$ref: "#/definitions/tokens"
'400':
description: bad update request
schema:
$ref: "#/definitions/error"
'403':
description: cannot complete request
schema:
$ref: "#/definitions/error"
'404':
description: user not found
schema:
$ref: "#/definitions/error"
'500':
description: server error
schema:
$ref: "#/definitions/error"
default:
$ref: "#/responses/errorResponse"
/user/validate/{userHandle}:
parameters:
- $ref: "#/parameters/requestId"
- name: userHandle
in: path
type: string
required: true
get:
description: validate user
operationId: validate
tags:
- userservice
responses:
'200':
description: user validated
schema:
$ref: "#/definitions/userOut"
'400':
description: bad validation request
schema:
$ref: "#/definitions/error"
'403':
description: cannot complete validation request
schema:
$ref: "#/definitions/error"
'404':
description: user not found
schema:
$ref: "#/definitions/error"
'500':
description: server error
schema:
$ref: "#/definitions/error"
default:
$ref: "#/responses/errorResponse"
/user/pwreset:
parameters:
- $ref: "#/parameters/requestId"
post:
description: request user password reset
operationId: pwreset
tags:
- userservice
parameters:
- name: authInfo
in: body
schema:
$ref: '#/definitions/authInfo'
required: true
responses:
'200':
$ref: "#/responses/noContentResponse"
'400':
description: bad update request
schema:
$ref: "#/definitions/error"
'403':
description: cannot complete request
schema:
$ref: "#/definitions/error"
'404':
description: user not found
schema:
$ref: "#/definitions/error"
'500':
description: server error
schema:
$ref: "#/definitions/error"
default:
$ref: "#/responses/errorResponse"
/user/pwoverwrite/{userHandle}:
parameters:
- $ref: "#/parameters/requestId"
- name: userHandle
in: path
type: string
required: true
put:
description: update user password
operationId: pwoverwrite
tags:
- userservice
parameters:
- name: authInfo
in: body
schema:
$ref: '#/definitions/authInfo'
required: true
responses:
'200':
$ref: "#/responses/noContentResponse"
'400':
description: bad update request
schema:
$ref: "#/definitions/error"
'403':
description: cannot complete request
schema:
$ref: "#/definitions/error"
'404':
description: user not found
schema:
$ref: "#/definitions/error"
'500':
description: server error
schema:
$ref: "#/definitions/error"
default:
$ref: "#/responses/errorResponse"
/publickey:
parameters:
- $ref: "#/parameters/requestId"
get:
description: get public key
tags:
- publickey
operationId: publickey
responses:
'200':
description: public key in json format
schema:
$ref: "#/definitions/publicKey"
'500':
description: server error
schema:
$ref: "#/definitions/error"
default:
$ref: "#/responses/errorResponse"
/user/addtogroup:
parameters:
- $ref: "#/parameters/requestId"
put:
description: add user to group
operationId: add to group
tags:
- userservice
parameters:
- name: userGroup
in: body
schema:
$ref: '#/definitions/userGroup'
required: true
responses:
'200':
$ref: "#/responses/noContentResponse"
'201':
$ref: "#/responses/noContentResponse"
'400':
description: bad request
schema:
$ref: "#/definitions/error"
'403':
description: permission denied
schema:
$ref: "#/definitions/error"
'404':
description: not found
schema:
$ref: "#/definitions/error"
'409':
description: user already exists in group
schema:
$ref: "#/definitions/error"
'500':
description: server error
schema:
$ref: "#/definitions/error"
'501':
description: not implemented
schema:
$ref: "#/definitions/error"
default:
$ref: "#/responses/errorResponse"
/user/sendemail:
parameters:
- $ref: "#/parameters/requestId"
post:
description: send email
operationId: sendemail
tags:
- userservice
parameters:
- name: authInfo
in: body
schema:
$ref: '#/definitions/authInfo'
required: true
responses:
'200':
$ref: "#/responses/noContentResponse"
'500':
description: server error
schema:
$ref: "#/definitions/error"
default:
$ref: "#/responses/errorResponse"
definitions:
authInfo:
description: authentication info
properties:
emailAddress:
description: user email address
type: string
format: email
password:
description: user password
type: string
required:
- emailAddress
- password
refreshInfo:
description: refresh info
properties:
emailAddress:
description: user email address
type: string
format: email
token:
description: refresh token
type: string
required:
- emailAddress
- token
userIn:
description: user definition
properties:
firstName:
description: user first name
type: string
lastName:
description: user last name
type: string
emailAddress:
description: email address
type: string
format: email
password:
description: user password
type: string
required:
- firstName
- lastName
- emailAddress
- password
userOut:
description: user definition
properties:
firstName:
description: user first name
type: string
lastName:
description: user last name
type: string
emailAddress:
description: email address
type: string
format: email
disabled:
description: disabled
type: boolean
locked:
description: locked after failed login
type: boolean
required:
- firstName
- lastName
- emailAddress
- disabled
- locked
userDel:
description: user delete
properties:
emailAddress:
description: email address
type: string
format: email
force:
description: force delete
type: boolean
required:
- emailAddress
- force
userGroup:
description: user and group info
properties:
emailAddress:
description: user email address
type: string
format: email
group:
description: group name
type: string
required:
- emailAddress
- group
tokens:
description: tokens
properties:
idToken:
description: OIDC ID token
type: string
accessToken:
description: OIDC Access Token
type: string
refreshToken:
description: OIDC Refresh Token
type: string
required:
- idToken
- accessToken
- refreshToken
error:
description: the error model all error responses return
type: object
properties:
code:
type: integer
format: int
message:
type: string
helpUrl:
type: string
format: uri
causes:
type: array
description: any indirect causes
items:
$ref: '#/definitions/error'
publicKey:
description: Lightwave publickey
properties:
jsonPublicKey:
description: LW public key in json format
type: string
required:
- jsonPublicKey
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment