Update swagger yaml

This commit is contained in:
Khanh Ngo 2020-05-17 21:00:13 +07:00
parent fd0485d897
commit 0ef132a7be
No known key found for this signature in database
GPG Key ID: D5FAA6A16150E49E

View File

@ -457,9 +457,9 @@ paths:
# and replaced with # and replaced with
# type: string # type: string
# or something like that # or something like that
- $ref: '#/definitions/StatisticItem' $ref: '#/definitions/MapStatisticItem'
- $ref: '#/definitions/MapStatisticItem' # - $ref: '#/definitions/StatisticItem'
- $ref: '#/definitions/RingStatisticItem' # - $ref: '#/definitions/RingStatisticItem'
'/servers/{server_id}/search-data': '/servers/{server_id}/search-data':
get: get:
@ -897,7 +897,7 @@ paths:
security: security:
- basicAuth: [] - basicAuth: []
summary: 'Get a specific apikey on the server, hashed' summary: 'Get a specific apikey on the server, hashed'
operationId: api_get_apikeys operationId: api_get_apikey_by_id
tags: tags:
- apikey - apikey
responses: responses:
@ -977,11 +977,11 @@ paths:
schema: schema:
type: array type: array
items: items:
$ref: #/definitions/User $ref: '#/definitions/User'
'500': '500':
description: Internal Server Error, users could not be retrieved. Contains error message description: Internal Server Error, users could not be retrieved. Contains error message
schema: schema:
$ref: #/definitions/Error $ref: '#/definitions/Error'
post: post:
security: security:
- basicAuth: [] - basicAuth: []
@ -991,59 +991,58 @@ paths:
tags: tags:
- user - user
parameters: parameters:
- name: username - in: body
name: user
description: The user to create
schema:
type: object
required:
- username
- email
properties:
username:
type: string
description: Login name for user (unique, immutable) description: Login name for user (unique, immutable)
required: true password:
in: body type: string
- name: password
description: Hashed password for authentication description: Hashed password for authentication
required: false plain_text_password:
in: body type: string
- name: plain_text_password
description: Plain text password (will be hashed) for authentication description: Plain text password (will be hashed) for authentication
required: false firstname:
in: body type: string
- name: firstname
description: Firstname of user description: Firstname of user
required: false lastname:
in: body type: string
- name: lastname
description: Lastname of user description: Lastname of user
required: false email:
in: body type: string
- name: email
description: Email address if user (must be unique) description: Email address if user (must be unique)
required: true otp_secret:
in: body type: string
- name: otp_secret
description: OTP secret description: OTP secret
required: false confirmed:
in: body type: string
- name: confirmed
description: Confirmed status description: Confirmed status
required: false role_name:
in: body type: string
- name: role_name
description: Name of role to be assigned to user (default 'User') description: Name of role to be assigned to user (default 'User')
required: false role_id:
in: body type: integer
- name: role_id
description: Role ID of role to be assigned to user description: Role ID of role to be assigned to user
required: false
in: body
responses: responses:
'201': '201':
description: Created description: Created
schema: schema:
$ref: #/definitions/User $ref: '#/definitions/User'
'400': '400':
description: Unprocessable Entry, the User data provided has issues description: Unprocessable Entry, the User data provided has issues
schema: schema:
$ref: #/definitions/Error $ref: '#/definitions/Error'
'500': '500':
description: Internal Server Error. There was a problem creating the user description: Internal Server Error. There was a problem creating the user
schema: schema:
$ref: #/definitions/Error $ref: '#/definitions/Error'
'/pdnsadmin/users/{username}': '/pdnsadmin/users/{username}':
parameters: parameters:
- name: username - name: username
@ -1055,22 +1054,22 @@ paths:
security: security:
- basicAuth: [] - basicAuth: []
summary: Get a specific User on the server summary: Get a specific User on the server
operationId: api_list_users operationId: api_get_user
tags: tags:
- user - user
responses: responses:
'200': '200':
description: Retrieve a specific User description: Retrieve a specific User
schema: schema:
$ref: #/definitions/User $ref: '#/definitions/User'
'404': '404':
description: Not found. The User with the specified username does not exist description: Not found. The User with the specified username does not exist
schema: schema:
$ref: #/definitions/Error $ref: '#/definitions/Error'
'500': '500':
description: Internal Server Error, user could not be retrieved. Contains error message description: Internal Server Error, user could not be retrieved. Contains error message
schema: schema:
$ref: #/definitions/Error $ref: '#/definitions/Error'
'/pdnsadmin/users/{user_id}': '/pdnsadmin/users/{user_id}':
parameters: parameters:
- name: user_id - name: user_id
@ -1086,57 +1085,52 @@ paths:
tags: tags:
- user - user
parameters: parameters:
- name: username - in: body
name: user
schema:
type: object
properties:
username:
type: string
description: Login name for user (unique, immutable) description: Login name for user (unique, immutable)
required: false password:
in: body type: string
- name: password
description: Hashed password for authentication description: Hashed password for authentication
required: false plain_text_password:
in: body type: string
- name: plain_text_password
description: Plain text password (will be hashed) for authentication description: Plain text password (will be hashed) for authentication
required: false firstname:
in: body type: string
- name: firstname
description: Firstname of user description: Firstname of user
required: false lastname:
in: body type: string
- name: lastname
description: Lastname of user description: Lastname of user
required: false email:
in: body type: string
- name: email
description: Email address if user (must be unique) description: Email address if user (must be unique)
required: false otp_secret:
in: body type: string
- name: otp_secret
description: OTP secret description: OTP secret
required: false confirmed:
in: body type: string
- name: confirmed
description: Confirmed status description: Confirmed status
required: false role_name:
in: body type: string
- name: role_name
description: Name of role to be assigned to user (default 'User') description: Name of role to be assigned to user (default 'User')
required: false role_id:
in: body type: string
- name: role_id
description: Role id of role to be assigned to user description: Role id of role to be assigned to user
required: false
in: body
responses: responses:
'204': '204':
description: OK. User is modified (empty response body) description: OK. User is modified (empty response body)
'404': '404':
description: Not found. The User with the specified user_id does not exist description: Not found. The User with the specified user_id does not exist
schema: schema:
$ref: #/definitions/Error $ref: '#/definitions/Error'
'500': '500':
description: Internal Server Error. Contains error message description: Internal Server Error. Contains error message
schema: schema:
$ref: #/definitions/Error $ref: '#/definitions/Error'
delete: delete:
security: security:
- basicAuth: [] - basicAuth: []
@ -1150,11 +1144,11 @@ paths:
'404': '404':
description: Not found. The User with the specified user_id does not exist description: Not found. The User with the specified user_id does not exist
schema: schema:
$ref: #/definitions/Error $ref: '#/definitions/Error'
'500': '500':
description: Internal Server Error. Contains error message description: Internal Server Error. Contains error message
schema: schema:
$ref: #/definitions/Error $ref: '#/definitions/Error'
'/pdnsadmin/accounts': '/pdnsadmin/accounts':
get: get:
security: security:
@ -1169,11 +1163,11 @@ paths:
schema: schema:
type: array type: array
items: items:
$ref: #/definitions/Account $ref: '#/definitions/Account'
'500': '500':
description: Internal Server Error, accounts could not be retrieved. Contains error message description: Internal Server Error, accounts could not be retrieved. Contains error message
schema: schema:
$ref: #/definitions/Error $ref: '#/definitions/Error'
post: post:
security: security:
- basicAuth: [] - basicAuth: []
@ -1183,35 +1177,37 @@ paths:
tags: tags:
- account - account
parameters: parameters:
- name: name - in: body
name: account
schema:
required:
- name
properties:
name:
type: string
description: Name for account (unique, immutable) description: Name for account (unique, immutable)
required: true description:
in: body type: string
- name: description
description: Description of account description: Description of account
required: false contact:
in: body type: string
- name: contact
description: Contact information description: Contact information
required: false mail:
in: body type: string
- name: mail
description: Email address for contact description: Email address for contact
required: false
in: body
responses: responses:
'201': '201':
description: Created description: Created
schema: schema:
$ref: #/definitions/Account $ref: '#/definitions/Account'
'400': '400':
description: Unprocessable Entry, the Account data provided has issues. description: Unprocessable Entry, the Account data provided has issues.
schema: schema:
$ref: #/definitions/Error $ref: '#/definitions/Error'
'500': '500':
description: Internal Server Error. There was a problem creating the account description: Internal Server Error. There was a problem creating the account
schema: schema:
$ref: #/definitions/Error $ref: '#/definitions/Error'
'/pdnsadmin/accounts/{account_name}': '/pdnsadmin/accounts/{account_name}':
parameters: parameters:
- name: account_name - name: account_name
@ -1223,22 +1219,22 @@ paths:
security: security:
- basicAuth: [] - basicAuth: []
summary: Get a specific Account on the server summary: Get a specific Account on the server
operationId: api_list_accounts operationId: api_get_account_by_name
tags: tags:
- user - user
responses: responses:
'200': '200':
description: Retrieve a specific account description: Retrieve a specific account
schema: schema:
$ref: #/definitions/Account $ref: '#/definitions/Account'
'404': '404':
description: Not found. The Account with the specified name does not exist description: Not found. The Account with the specified name does not exist
schema: schema:
$ref: #/definitions/Error $ref: '#/definitions/Error'
'500': '500':
description: Internal Server Error, account could not be retrieved. Contains error message description: Internal Server Error, account could not be retrieved. Contains error message
schema: schema:
$ref: #/definitions/Error $ref: '#/definitions/Error'
'/pdnsadmin/accounts/{account_id}': '/pdnsadmin/accounts/{account_id}':
parameters: parameters:
- name: account_id - name: account_id
@ -1254,33 +1250,35 @@ paths:
tags: tags:
- user - user
parameters: parameters:
- name: name - in: body
name: account
schema:
required:
- name
properties:
name:
type: string
description: Name for account (unique, immutable) description: Name for account (unique, immutable)
required: true description:
in: body type: string
- name: description
description: Description of account description: Description of account
required: false contact:
in: body type: string
- name: contact
description: Contact information description: Contact information
required: false mail:
in: body type: string
- name: mail
description: Email address for contact description: Email address for contact
required: false
in: body
responses: responses:
'204': '204':
description: OK. Account is modified (empty response body) description: OK. Account is modified (empty response body)
'404': '404':
description: Not found. The Account with the specified account_id does not exist description: Not found. The Account with the specified account_id does not exist
schema: schema:
$ref: #/definitions/Error $ref: '#/definitions/Error'
'500': '500':
description: Internal Server Error. Contains error message description: Internal Server Error. Contains error message
schema: schema:
$ref: #/definitions/Error $ref: '#/definitions/Error'
delete: delete:
security: security:
- basicAuth: [] - basicAuth: []
@ -1294,11 +1292,11 @@ paths:
'404': '404':
description: Not found. The Account with the specified account_id does not exist description: Not found. The Account with the specified account_id does not exist
schema: schema:
$ref: #/definitions/Error $ref: '#/definitions/Error'
'500': '500':
description: Internal Server Error. Contains error message description: Internal Server Error. Contains error message
schema: schema:
$ref: #/definitions/Error $ref: '#/definitions/Error'
'/pdnsadmin/accounts/users/{account_id}': '/pdnsadmin/accounts/users/{account_id}':
parameters: parameters:
- name: account_id - name: account_id
@ -1320,15 +1318,15 @@ paths:
schema: schema:
type: array type: array
items: items:
$ref: #/definitions/User $ref: '#/definitions/User'
'404': '404':
description: Not found. The Account with the specified account_id does not exist description: Not found. The Account with the specified account_id does not exist
schema: schema:
$ref: #/definitions/Error $ref: '#/definitions/Error'
'500': '500':
description: Internal Server Error, accounts could not be retrieved. Contains error message description: Internal Server Error, accounts could not be retrieved. Contains error message
schema: schema:
$ref: #/definitions/Error $ref: '#/definitions/Error'
'/pdnsadmin/accounts/users/{account_id}/{user_id}': '/pdnsadmin/accounts/users/{account_id}/{user_id}':
parameters: parameters:
- name: account_id - name: account_id
@ -1355,11 +1353,11 @@ paths:
'404': '404':
description: Not found. The Account or User with the specified id does not exist description: Not found. The Account or User with the specified id does not exist
schema: schema:
$ref: #/definitions/Error $ref: '#/definitions/Error'
'500': '500':
description: Internal Server Error. Contains error message description: Internal Server Error. Contains error message
schema: schema:
$ref: #/definitions/Error $ref: '#/definitions/Error'
delete: delete:
security: security:
- basicAuth: [] - basicAuth: []
@ -1374,11 +1372,11 @@ paths:
'404': '404':
description: Not found. The Account or User with the specified id does not exist or user was not linked to account description: Not found. The Account or User with the specified id does not exist or user was not linked to account
schema: schema:
$ref: #/definitions/Error $ref: '#/definitions/Error'
'500': '500':
description: Internal Server Error. Contains error message description: Internal Server Error. Contains error message
schema: schema:
$ref: #/definitions/Error $ref: '#/definitions/Error'
definitions: definitions:
@ -1750,7 +1748,7 @@ definitions:
type: array type: array
description: 'named statistic values' description: 'named statistic values'
items: items:
type: array type: object
properties: properties:
name: name:
type: string type: string
@ -1774,7 +1772,7 @@ definitions:
type: array type: array
description: 'named ring statistic values' description: 'named ring statistic values'
items: items:
type: array type: object
properties: properties:
name: name:
type: string type: string