A service is a special kind of resource that besides Resource properties, it could offer:

  • Its own REST API endpoints, using an express router, to expose details about service, this endpoints will be exposed under the observability paths.
  • A links property to define the endpoints that the service expose, this information will be exposed in the observability paths.
  • A metrics property to expose the metrics of the service, this registry will be merged with the global metrics registry.

Type Parameters

  • T
  • K

Hierarchy (View Summary)

Implements

Constructors

Properties

Accessors

Methods

Events

Constructors

Properties

componentId: string = ...

Component identification

Accessors

  • get name(): string
  • Component name

    Returns string

  • get router(): Router
  • Return an Express router with access to OpenC2 information

    Returns Router

  • get status(): "pass" | "fail" | "warn"
  • Component health status

    Returns "pass" | "fail" | "warn"

Methods

  • Close the OpenC2 component

    Returns Promise<void>

  • Connect the OpenC2 Adapter to the underlayer transport system and perform the startup of the component

    Returns Promise<void>

  • Disconnect the OpenC2 Adapter to the underlayer transport system and perform the shutdown of the component

    Returns Promise<void>

Events

  • Add a listener for the error event, emitted when the component detects an error.

    Parameters

    • event: "error"

      error event

    • listener: (error: Crash | Multi | Error) => void

      Error event listener

    Returns this

  • Add a listener for the status event, emitted when the component status changes.

    Parameters

    • event: "status"

      status event

    • listener: (status: "pass" | "fail" | "warn") => void

      Status event listener

    Returns this