INTO-CPS-Association/DTaaS

View on GitHub
docs/developer/servers/execution/runner/runner-api.yaml

Summary

Maintainability
Test Coverage
openapi: '3.0.2'
info:
  title: Digital Twin Runner API
  version: '0.0.1'
  contact:
    name: Prasad Talasila
    url: https://github.com/INTO-CPS-Association/DTaaS
  license:
    name: The INTO-CPS Association
    url: https://into-cps.org
  description: |
    The Digital Twin (DT) Runner is a component of Digital Twin as a Service (DTaaS) software. The DT Runner component is responsible for managing the execution of one digital twin.
    
    This document describes the API for the DT Runner. 

servers:
  - url: https://api.server.test/v0.0.1
paths:
  /controller/status:
    get:
      description: 'Check the status of the Digital Twin Runner. This is a heartbeat check.'
      responses:
        '200':
          description: Aliv-e
        '404':
          description: 'Service is unavailable'

  /controller/logs:
    get:
      description: 'Fetch the logs of Digital Twin Runner.'
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                type: string
                example: |
                  '[20:20:10] Request received'
        '404':
          description: 'Service is unavailable'

  /controller/terminate:
    get:
      description: 'Stop the Digital Twin managed by Digital Twin Runner and exit.'
      responses:
        '200':
          description: Shutting down
        '404':
          description: 'Service is unavailable'

  /dt/lifecycle/phase/list:
    get:
      description: |
        'Fetch the list of lifecycle phases supported by the digital twin. These lifecycles are given as configuration information to the Digital Twin Runner.'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Phases"
                      
  /dt/lifecycle/phase/{phaseName}:
    post:
      description: |
        'Change to the lifecycle phase indicated in the request URL'
      parameters:
        - in: path
          name: phaseName
          schema:
            type: string
          required: true
          description: Phase name of digital twin        
      responses:
        '200':
          description: OK
                      
  /dt/lifecycle/phase/history:
    get:
      description: |
        'Get the history of phase change requests made to the digital twin.'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
                example: ["execute", "evolve"]
                      
components:
  schemas:
    Phase: 
      type: object
      properties:
        phaseName:
          type: string
          example: execute
        description: 
          type: string
          example: "execute the digital twin"
    Phases:
      type: array
      items:
        $ref: "#/components/schemas/Phase"
      example: |
        [{phaseName: configure, description: "set configuration of digital twin"}, {phaseName: execute, description: "execute the digital twin"}]