diff --git a/docs/openapi.yaml b/docs/openapi.yaml index a017305..fe3250c 100644 --- a/docs/openapi.yaml +++ b/docs/openapi.yaml @@ -713,16 +713,7 @@ paths: description: Activate a cloud account for the calling user responses: "200": - description: Success - content: - application/json: - schema: - type: object - properties: - status: - type: string - description: '"OK"' - example: {"status": "OK"} + "$ref": "#/components/responses/SimpleSuccessResponse" "403": "$ref": "#/components/responses/InvalidMembershipErrorResponse" /cloud/accounts/purge: @@ -757,6 +748,79 @@ paths: description: usernames of accounts which were deleted items: type: string + /cloud/vhosts/{domain}: + put: + tags: ['cloud'] + servers: + - url: https://biloba.csclub.uwaterloo.ca:9987/api + summary: Create a vhost + description: Add a new virtual host configuration. + parameters: + - name: domain + in: path + description: domain name of the virtual host + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + ip_address: + type: string + description: IP address of the virtual host + example: {"ip_address": "172.19.134.11"} + responses: + "200": + "$ref": "#/components/responses/SimpleSuccessResponse" + "403": + "$ref": "#/components/responses/InvalidMembershipErrorResponse" + delete: + tags: ['cloud'] + servers: + - url: https://biloba.csclub.uwaterloo.ca:9987/api + summary: Delete a vhost + description: Delete a virtual host configuration. + parameters: + - name: domain + in: path + description: domain name of the virtual host + required: true + schema: + type: string + responses: + "200": + "$ref": "#/components/responses/SimpleSuccessResponse" + /cloud/vhosts: + get: + tags: ['cloud'] + servers: + - url: https://biloba.csclub.uwaterloo.ca:9987/api + summary: List all vhosts + description: List all virtual host configurations for the calling user. + responses: + "200": + description: Success + content: + application/json: + schema: + type: object + properties: + vhosts: + type: array + description: virtual hosts + items: + type: object + properties: + domain: + type: string + description: domain name of the virtual host + ip_address: + type: string + description: IP address of the virtual host + example: {"vhosts": [{"domain": "ctdalek.m.csclub.cloud", "ip_address": "172.19.134.11"}]} components: securitySchemes: GSSAPIAuth: @@ -932,3 +996,14 @@ components: InvalidMembershipErrorResponse: <<: *ErrorResponse description: Membership is invalid or expired + SimpleSuccessResponse: + description: Success + content: + application/json: + schema: + type: object + properties: + status: + type: string + description: '"OK"' + example: {"status": "OK"} diff --git a/docs/redoc-static.html b/docs/redoc-static.html index 0ccf8ea..708eff9 100644 --- a/docs/redoc-static.html +++ b/docs/redoc-static.html @@ -352,7 +352,8 @@ data-styled.g108[id="sc-dWBRfb"]{content:"jnEbBv,"}/*!sc*/ .cAOCuf{font-size:0.929em;line-height:20px;background-color:#2F8132;color:#ffffff;padding:3px 10px;text-transform:uppercase;font-family:Montserrat,sans-serif;margin:0;}/*!sc*/ .iZkjfb{font-size:0.929em;line-height:20px;background-color:#bf581d;color:#ffffff;padding:3px 10px;text-transform:uppercase;font-family:Montserrat,sans-serif;margin:0;}/*!sc*/ .gemyvL{font-size:0.929em;line-height:20px;background-color:#cc3333;color:#ffffff;padding:3px 10px;text-transform:uppercase;font-family:Montserrat,sans-serif;margin:0;}/*!sc*/ -data-styled.g109[id="sc-jHcXXw"]{content:"bXnXQF,cAOCuf,iZkjfb,gemyvL,"}/*!sc*/ +.inNGOu{font-size:0.929em;line-height:20px;background-color:#95507c;color:#ffffff;padding:3px 10px;text-transform:uppercase;font-family:Montserrat,sans-serif;margin:0;}/*!sc*/ +data-styled.g109[id="sc-jHcXXw"]{content:"bXnXQF,cAOCuf,iZkjfb,gemyvL,inNGOu,"}/*!sc*/ .gBwOdz{position:absolute;width:100%;z-index:100;background:#fafafa;color:#263238;box-sizing:border-box;box-shadow:0px 0px 6px rgba(0,0,0,0.33);overflow:hidden;border-bottom-left-radius:4px;border-bottom-right-radius:4px;-webkit-transition:all 0.25s ease;transition:all 0.25s ease;visibility:hidden;-webkit-transform:translateY(-50%) scaleY(0);-ms-transform:translateY(-50%) scaleY(0);transform:translateY(-50%) scaleY(0);}/*!sc*/ data-styled.g110[id="sc-bQCEYZ"]{content:"gBwOdz,"}/*!sc*/ .fKFAhr{padding:10px;}/*!sc*/ @@ -429,7 +430,7 @@ data-styled.g140[id="sc-amkrK"]{content:"icZuVc,"}/*!sc*/ -
Authorizations:

Responses

Response samples

Content type
application/json
{
  • "accounts_to_be_deleted": [
    ],
  • "accounts_deleted": [
    ]
}

positions

Show current positions

Shows the list of positions and members holding them.

+

Response samples

Content type
application/json
{
  • "accounts_to_be_deleted": [
    ],
  • "accounts_deleted": [
    ]
}

Create a vhost

Add a new virtual host configuration.

+
Authorizations:
path Parameters
domain
required
string

domain name of the virtual host

+
Request Body schema: application/json
ip_address
string

IP address of the virtual host

+

Responses

Request samples

Content type
application/json
{
  • "ip_address": "172.19.134.11"
}

Response samples

Content type
application/json
{
  • "status": "OK"
}

Delete a vhost

Delete a virtual host configuration.

+
Authorizations:
path Parameters
domain
required
string

domain name of the virtual host

+

Responses

Response samples

Content type
application/json
{
  • "status": "OK"
}

List all vhosts

List all virtual host configurations for the calling user.

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "president": "user0",
  • "vice-president": "user1",
  • "sysadmin": "user2",
  • "treasurer": null
}

Update positions

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.

+

Response samples

Content type
application/json
{
  • "vhosts": [
    ]
}

positions

Show current positions

Shows the list of positions and members holding them.

+
Authorizations:

Responses

Response samples

Content type
application/json
{
  • "president": "user0",
  • "vice-president": "user1",
  • "sysadmin": "user2",
  • "treasurer": null
}

Update positions

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.

Authorizations:
Request Body schema: application/json

New position holders

property name*
string

Responses

Request samples

Content type
application/json
{
  • "president": "user0",
  • "vice-president": "user1",
  • "sysadmin": "user2",
  • "treasurer": null
}

Response samples

Content type
text/plain
{"status": "in progress", "operation": "update_positions_ldap"}
+

Request samples

Content type
application/json
{
  • "president": "user0",
  • "vice-president": "user1",
  • "sysadmin": "user2",
  • "treasurer": null
}

Response samples

Content type
text/plain
{"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"}
-
+