vorteil/direktiv

View on GitHub
openapi/src/paths/services.yaml

Summary

Maintainability
Test Coverage

/api/v2/namespaces/{namespace}/services:
  get:
    tags:
      - services
    summary: Get all services
    # description:
    parameters:
      - $ref: '../parameters.yaml#/namespace'
    responses:
      "200":
        description: Services list returned
        content:
          application/json:
            schema:
              type: object
              properties:
                data:
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        type: string
                        description: a unique string that represent id of the service
                      type:
                        type: string
                        description: enum value ("workflow-service" or "namespace-service")
                      namespace:
                        type: string
                        description: the namespace of service belongs
                      name:
                        type: string
                        description: name of the service
                      filePath:
                        type: string
                        description: file path where this service is defined
                      image:
                        type: string
                        description: docker image of the service
                      cmd:
                        type: string
                        description: docker command
                      size:
                        type: string
                        description: can be 'large', 'medium' or 'small'
                      scale:
                        type: integer
                        description: number from 0 to 9
                      error:
                        type: [ string, null ]
                        description: error string when service failed to be scheduled, otherwise null
                      envs:
                        type: array
                        nullable: false
                        description: environment variables used to exec the service
                        items:
                          type: object
                          properties:
                            name:
                              type: string
                              description: name of the variable
                            value:
                              type: string
                              description: value of the variable
                      conditions:
                        type: array
                        nullable: true
                        description: list of checks indicating the health checks of the service, null value means the service is not scheduled yet
                        items:
                          type: object
                          properties:
                            type:
                              type: string
                              description: name of the check
                            status:
                              type: string
                              description: can be 'True', 'False' or 'Unknown'
                            message:
                              type: string
                              description: human readable message about the reason of this condition - can be empty

/api/v2/namespaces/{namespace}/services/{serviceID}/pods:
  get:
    tags:
      - services
    summary: Get all pods for a given service
    # description:
    parameters:
      - $ref: '../parameters.yaml#/namespace'
      - $ref: '../parameters.yaml#/serviceID'
    responses:
      "200":
        description: Pods list returned
        content:
          application/json:
            schema:
              type: object
              properties:
                data:
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        type: string
                        description: a unique string that represent id of the pod

/api/v2/namespaces/{namespace}/services/{serviceID}/pods/{podID}/logs:
  get:
    tags:
      - services
    summary: Stream logs for a given pod
    # description:
    parameters:
      - $ref: '../parameters.yaml#/namespace'
      - $ref: '../parameters.yaml#/serviceID'
      - $ref: '../parameters.yaml#/podID'
    responses:
      "200":
        description: Stream of plain text log data

/api/v2/namespaces/{namespace}/services/{serviceID}/actions/rebuild:
  post:
    tags:
      - services
    summary:  Rebuilds service
    # description:
    parameters:
      - $ref: '../parameters.yaml#/namespace'
      - $ref: '../parameters.yaml#/serviceID'
    responses:
      "200":
        description: Service rebuilds successfully