add api docs for positions
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
Rio Liu 2021-10-04 19:38:03 -04:00
parent 50c0e81643
commit 1cfa756199
1 changed files with 63 additions and 0 deletions

View File

@ -361,6 +361,69 @@ paths:
{"status": "completed", "result": {"removed_from_groups": ["group2","group3"], "unsubscribed_from_lists": ["list1","list2"]}}
"404":
$ref: "#/components/responses/GroupNotFoundErrorResponse"
/positions:
get:
tags: ['positions']
summary: Show current positions
description: >-
Shows the list of positions and members holding them.
responses:
"200":
description: Success
content:
application/json:
schema:
type: object
additionalProperties:
type: string
example:
president: user0
vice-president: user1
sysadmin: user2
treasurer:
post:
tags: ['positions']
summary: Update positions
description: >-
Update members for each positions. Members not specified in the parameters will be removed
from the position and unsubscribed from the exec's mailing list. New position holders will
be subscribed to the mailing list.
requestBody:
description: New position holders
required: true
content:
application/json:
schema:
type: object
additionalProperties:
type: string
example:
president: user0
vice-president: user1
sysadmin: user2
treasurer:
responses:
"200":
description: Success
content:
text/plain:
schema:
type: string
description: Streaming response
example: |
{"status": "in progress", "operation": "update_positions_ldap"}
{"status": "in progress", "operation": "update_exec_group_ldap"}
{"status": "in progress", "operation": "subscribe_to_mailing_list"}
{"status": "completed", "result": "OK"}
"400":
description: Failed
content:
application/json:
schema:
type: object
properties:
error:
type: string
/mailman/{mailing_list}/{username}:
post:
tags: ['mailman']