OpenC3/cosmos

View on GitHub
openc3/data/config/interface_modifiers.yaml

Summary

Maintainability
Test Coverage
---
MAP_TARGET:
  summary: Maps a target name to an interface
  parameters:
    - name: Target Name
      required: true
      description: Target name to map to this interface
      values: .+
  ruby_example: |
    INTERFACE DATA_INT tcpip_client_interface.rb host.docker.internal 8080 8081 10.0 nil BURST
      MAP_TARGET DATA
  python_example: |
    INTERFACE DATA_INT openc3/interfaces/tcpip_client_interface.py host.docker.internal 8080 8081 10.0 nil BURST
      MAP_TARGET DATA
MAP_CMD_TARGET:
  summary: Maps a target name to an interface for commands only
  since: 5.2.0
  parameters:
    - name: Target Name
      required: true
      description: Command target name to map to this interface
      values: .+
  ruby_example: |
    INTERFACE CMD_INT tcpip_client_interface.rb host.docker.internal 8080 8081 10.0 nil BURST
      MAP_CMD_TARGET DATA # Only DATA commands go on the CMD_INT interface
  python_example: |
    INTERFACE CMD_INT openc3/interfaces/tcpip_client_interface.py host.docker.internal 8080 8081 10.0 nil BURST
      MAP_CMD_TARGET DATA # Only DATA commands go on the CMD_INT interface
MAP_TLM_TARGET:
  summary: Maps a target name to an interface for telemetry only
  since: 5.2.0
  parameters:
    - name: Target Name
      required: true
      description: Telemetry target name to map to this interface
      values: .+
  ruby_example: |
    INTERFACE TLM_INT tcpip_client_interface.rb host.docker.internal 8080 8081 10.0 nil BURST
      MAP_TLM_TARGET DATA # Only DATA telemetry received on TLM_INT interface
  python_example: |
    INTERFACE TLM_INT openc3/interfaces/tcpip_client_interface.py host.docker.internal 8080 8081 10.0 nil BURST
      MAP_TLM_TARGET DATA # Only DATA telemetry received on TLM_INT interface
DONT_CONNECT:
  summary: Server will not automatically try to connect to the interface at startup
DONT_RECONNECT:
  summary: Server will not try to reconnect to the interface if the connection is lost
RECONNECT_DELAY:
  summary: Reconnect delay in seconds
  description:
    If DONT_RECONNECT is not present the Server will try to reconnect to an
    interface if the connection is lost. Reconnect delay sets the interval in seconds
    between reconnect tries.
  parameters:
    - name: Delay
      required: true
      description: Delay in seconds between reconnect attempts. The default is 15 seconds.
      values: ([0-9]*[.])?[0-9]+
DISABLE_DISCONNECT:
  summary: Disable the Disconnect button on the Interfaces tab in the Server
  description:
    Use this keyword to prevent the user from disconnecting from the interface.
    This is typically used in a 'production' environment where you would not want
    the user to inadvertently disconnect from a target.
LOG_RAW:
  summary: Deprecated, use LOG_STREAM
LOG_STREAM:
  summary: Log all data on the interface exactly as it is sent and received
  description:
    LOG_STREAM does not add any OpenC3 headers and thus can not be read by OpenC3 tools.
    It is primarily useful for low level debugging of an interface. You will have to
    manually parse these logs yourself using a hex editor or other application.
  since: 5.5.2
  parameters:
    - name: Cycle Time
      required: false
      description:
        Amount of time to wait before cycling the log file. Default is 10 min.
        If nil refer to Cycle Hour and Cycle Minute.
      values: .*
    - name: Cycle Size
      required: false
      description: Amount of data to write before cycling the log file. Default is 50MB.
      values: .*
    - name: Cycle Hour
      required: false
      description:
        The time at which to cycle the log. Combined with Cycle Minute to cycle
        the log daily at the specified time. If nil, the log will be cycled hourly at the specified Cycle Minute.
        Only applies if Cycle Time is nil.
      values: .*
    - name: Cycle Minute
      required: false
      description: See Cycle Hour.
      values: .*
  example: |
    INTERFACE EXAMPLE example_interface.rb
      # Override the default log time of 600
      LOG_STREAM 60
PROTOCOL:
  summary: Protocols modify the interface by processing the data
  description:
    Protocols can be either READ, WRITE, or READ_WRITE. READ protocols act on the data
    received by the interface while write acts on the data before it is sent out. READ_WRITE applies
    the protocol to both reading and writing.<br/><br/>
    For information on creating your own custom protocol please see [Protocols](../configuration/protocols.md)
  since: 4.0.0
  parameters:
    - name: Type
      required: true
      description: Whether to apply the protocol on incoming data, outgoing data, or both
      values: ["READ", "WRITE", "READ_WRITE"]
    - name: Protocol Filename or Classname
      required: true
      description: Ruby or Python filename or class name which implements the protocol
      values: .*
    - name: Protocol specific parameters
      required: false
      description: Additional parameters used by the protocol
  ruby_example: |
    INTERFACE DATA_INT tcpip_client_interface.rb host.docker.internal 8080 8081 10.0 nil nil
      MAP_TARGET DATA
      # Rather than defining the LENGTH protocol on the INTERFACE line we define it here
      PROTOCOL READ LengthProtocol 0 16 0 1 BIG_ENDIAN 4 0xBA5EBA11
  python_example: |
    INTERFACE DATA_INT openc3/interfaces/tcpip_client_interface.py host.docker.internal 8080 8081 10.0 nil BURST
      MAP_TARGET DATA
      PROTOCOL READ IgnorePacketProtocol INST IMAGE # Drop all INST IMAGE packets
OPTION:
  summary: Set a parameter on an interface
  description:
    When an option is set the interface class calls the set_option method.
    Custom interfaces can override set_option to handle any additional options they want.
  parameters:
    - name: Name
      required: true
      description:
        The option to set. OpenC3 defines several options on the core provided
        interfaces. The SerialInterface defines FLOW_CONTROL which can be NONE (default) or RTSCTS
        and DATA_BITS which changes the data bits of the serial interface.
        The TcpipServerInterface and HttpServerInterface define LISTEN_ADDRESS which is the IP address to accept
        connections on (default 0.0.0.0).
      values: .*
    - name: Parameters
      required: false
      description: Parameters to pass to the option
      values: .*
  example: |
    INTERFACE SERIAL_INT serial_interface.rb COM1 COM1 115200 NONE 1 10.0 nil
      OPTION FLOW_CONTROL RTSCTS
      OPTION DATA_BITS 8
    ROUTER SERIAL_ROUTER tcpip_server_interface.rb 2950 2950 10.0 nil BURST
      ROUTE SERIAL_INT
      OPTION LISTEN_ADDRESS 127.0.0.1
SECRET:
  summary: Define a secret needed by this interface
  description: Defines a secret for this interface and optionally assigns its value to an option
  since: 5.3.0
  parameters:
    - name: Type
      required: true
      description:
        ENV or FILE.  ENV will mount the secret into an environment variable.
        FILE mounts the secret into a file.
      values: .*
    - name: Secret Name
      required: true
      description: The name of the secret to retrieve
      values: .*
    - name: Environment Variable or File Path
      required: true
      description: Environment variable name or file path to store secret
      values: .*
    - name: Option Name
      required: false
      description: Interface option to pass the secret value
      values: .*
    - name: Secret Store Name
      required: false
      description: Name of the secret store for stores with multipart keys
      values: .*
  example: |
    SECRET ENV USERNAME ENV_USERNAME USERNAME
    SECRET FILE KEY "/tmp/DATA/cert" KEY
ENV:
  summary: Sets an environment variable in the microservice.
  since: 5.7.0
  parameters:
    - name: Key
      required: true
      description: Environment variable name
      values: .+
    - name: Value
      required: true
      description: Environment variable value
      values: .+
  example: |
    ENV COMPANY OpenC3
WORK_DIR:
  summary: Set the working directory
  description: Working directory to run the microservice CMD in.  Can be a path relative to the microservice folder in the plugin, or an absolute path in the container the microservice runs in.
  since: 5.7.0
  parameters:
    - name: Directory
      required: true
      description: Working directory to run the microservice CMD in. Can be a path relative to the microservice folder in the plugin, or an absolute path in the container the microservice runs in.
      values: .+
  example: |
    WORK_DIR '/openc3/lib/openc3/microservices'
PORT:
  summary: Open port for the microservice
  description: Kubernetes needs a Service to be applied to open a port so this is required for Kubernetes support
  since: 5.7.0
  parameters:
    - name: Number
      required: true
      description: Port number
      values: \d+
    - name: Protocol
      required: false
      description: Port protocol. Default is TCP.
      values: .+
  example: |
    PORT 7272
CMD:
  summary: Command line to execute to run the microservice.
  description: Command line to execute to run the microservice.
  since: 5.7.0
  parameters:
    - name: Args
      required: true
      description: One or more arguments to exec to run the microservice.
      values: .+
  ruby_example: CMD ruby interface_microservice.rb DEFAULT__INTERFACE__INT1
  python_example: CMD python interface_microservice.py DEFAULT__INTERFACE__INT1
CONTAINER:
  summary: Docker Container
  description: Container to execute and run the microservice in. Only used in COSMOS Enterprise Edition.
  since: 5.7.0
  parameters:
    - name: Args
      required: false
      description: Name of the container
      values: .+
ROUTE_PREFIX:
  summary: Prefix of route
  description: Prefix of route to the microservice to expose externally with Traefik
  since: 5.7.0
  parameters:
    - name: Route Prefix
      required: true
      description: Route prefix. Must be unique across all scopes. Something like /myprefix
      values: .*
  example: |
    ROUTE_PREFIX /interface