Commit d3f1844d authored by Jakob Moser's avatar Jakob Moser
Browse files

Add first version of API docs

parent d46205b5
Loading
Loading
Loading
Loading
+87 −0
Original line number Diff line number Diff line
---
openapi: 3.0.2
info:
  title: fscoli Status
  version: 1.0.0
  description: |
    Monitor the status of services of the Fachschaft Computerlinguistik, Universität Heidelberg
paths:
  /services:
    summary: Path used to manage the list of services.
    description: ""
    get:
      responses:
        "200":
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Service"
          description: Successful response - returns an array of `Service` entities.
      operationId: getServices
      summary: List all services
      description: Gets a list of all `Service` entities.
  /services/{host}:
    summary: Path used to manage a single service.
    description: ""
    get:
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Service"
          description: Successful response - returns a single `Service`.
      operationId: getService
      summary: Get a service
      description: Gets the details of a single instance of a `Service`.
    parameters:
      - name: host
        description: "The host name, which uniquely identifies the service."
        schema:
          type: string
        in: path
        required: true
components:
  schemas:
    Service:
      title: Root Type for Service
      description:
        "A service. Has a name, is reachable at some url and can be up\
        \ or down."
      required:
        - status
        - name
        - host
        - category
      type: object
      properties:
        name:
          description: Human-readable name of the service.
          type: string
          readOnly: true
        status:
          description: If the service is reachable or not.
          enum:
            - up
            - down
          type: string
          readOnly: true
        host:
          description: |-
            The host name of the service.

            This is not the URL, i.e. do not prefix this with a protocol (e.g. use example.com
            and not https://example.com)
          type: string
          readOnly: true
        category:
          description: A category this service fits in. Can be used on the UI to display it in a different section.
          type: string
          readOnly: true
      example:
        name: Website
        host: fachschaft.cl.uni-heidelberg.de
        status: up
        category: public