Exemplo n.º 1
0
class eBPF_Program_Instance_Schema(Base_Schema):
    """Represents an eBPF program instance installed in an execution environment."""

    doc = eBPF_Program_Instance_Document
    id = Str(required=True,
             example='packet-capture@apache',
             description=
             'Id of the eBPF program installed in an execution environment.')
    ebpf_program_catalog_id = Str(
        required=True,
        readonly=False,
        example='packet-capture',
        description='Id of the agent in the catalog.',
        validate=In.apply(eBPF_Program_Catalog_Document.get_ids),
        error_messages=In.error_messages)
    exec_env_id = Str(
        required=True,
        readonly=True,
        example='apache',
        description=
        "Id of the execution environment where the eBPF program instance is installed",
        validate=In.apply(Exec_Env_Document.get_ids),
        error_messages=In.error_messages)
    parameters = Nested(
        eBPF_Program_Instance_Parameter_Schema,
        many=True,
        unknown='INCLUDE',
        description='List of eBPF program instance parameters.',
        validate=Unique_List.apply('id'),
        error_messages=Unique_List.error_messages)
    description = Str(
        example='Collect system metrics from Apache HTTP Web Server.',
        description=
        'Short description of the agent installed in the execution environment.'
    )
Exemplo n.º 2
0
class Data_Schema(Base_Schema):
    """Represents the stored data."""

    doc = Data_Document
    id = Str(required=True,
             example='BXrHRn5RPU55Qh9JwMZn',
             description='Id of the data.')
    agent_instance_id = Str(
        readonly=True,
        example='filebeat@apache',
        description=
        "Id of the agent instance in the execution environment that collected the data",
        validate=In.apply(Agent_Instance_Document.get_ids),
        error_messages=In.error_messages)
    ebpf_program_instance_id = Str(
        readonly=True,
        example='packet-capture@apache',
        description=
        """Id of the eBPF program instance in the execution environment
                                                  that collected the data""",
        validate=In.apply(eBPF_Program_Instance_Document.get_ids),
        error_messages=In.error_messages)
    timestamp_event = Date_Time(
        format=FORMAT,
        readonly=True,
        example='2019/02/14 15:23:30',
        description='Timestamp of the event related to the collected data')
    timestamp_agent = Date_Time(
        format=FORMAT,
        readonly=True,
        example='2019/02/14 15:23:30',
        description='Timestamp when the agent instance collected the data')
Exemplo n.º 3
0
class Connection_Schema(Base_Schema):
    """Represents an connection between execution environments and network links."""

    doc = Connection_Document
    id = Str(required=True, example='conn-1', description='Id of connection.')
    exec_env_id = Str(required=True, readonly=True, example='apache',
                      description='Id of the connected execution environment.',
                      validate=In.apply(Exec_Env_Document.get_ids), error_messages=In.error_messages)
    network_link_id = Str(required=True, readonly=True, example='net-link-1',
                          description='Id of the connected network link.',
                          validate=In.apply(Network_Link_Document.get_ids), error_messages=In.error_messages)
    description = Str(example='Added to this network for debug purposes.',
                      description='Short description of the connection.')
Exemplo n.º 4
0
class Exec_Env_Schema(Base_Schema):
    """Represents an execution environment."""

    doc = Exec_Env_Document
    id = Str(required=True,
             example='apache',
             description='Id of the execution environment.')
    hostname = Str(required=True,
                   example='192.168.1.2',
                   description='Hostname of the execution environment.')
    type_id = Str(required=True,
                  example='vm',
                  description='Id of the execution environment type.',
                  validate=In.apply(Exec_Env_Type_Document.get_ids),
                  error_messages=In.error_messages)
    lcp = Nested(LCP_Schema,
                 readonly=True,
                 unknown='INCLUDE',
                 description='Data related to the LCP.')
    description = Str(
        example='Apache HTTP Web Server.',
        description='Short description of the execution environment,')
    enabled = Boolean(
        required=True,
        default=True,
        example='Yes',
        description='Indicate if the execution environment is enabled or not')
Exemplo n.º 5
0
class Pipeline_Schema(Base_Schema):
    """Represents the stored pipelines."""

    doc = Pipeline_Document
    id = Str(required=True,
             example='BXrHRn5RPU55Qh9JwMZn',
             description='Id of the pipeline.')
    name = Str(description='Used by the UI to create a new pipeline.',
               example='test-pipeline')
    agent_instance_ids = List_or_One(
        Str(validate=In.apply(Agent_Instance_Document.get_ids),
            error_messages=In.error_messages),
        description='Ids of the agent instances included in this pipeline.')
    algorithm_instance_ids = List_or_One(
        Str(validate=In.apply(Algorithm_Instance_Document.get_ids),
            error_messages=In.error_messages),
        description='Ids of the algorithm instances included in this pipeline.'
    )
Exemplo n.º 6
0
class Agent_Instance_Schema(Base_Schema):
    """Represents an agent instance installed in an execution environment."""

    doc = Agent_Instance_Document
    id = Str(required=True,
             example='filebeat@apache',
             description=
             'Id of the agent instance installed in an execution environment.')
    agent_catalog_id = Str(required=True,
                           readonly=True,
                           example='filebeat',
                           description='Id of the agent in the catalog.',
                           validate=In.apply(Agent_Catalog_Document.get_ids),
                           error_messages=In.error_messages)
    exec_env_id = Str(
        required=True,
        readonly=True,
        example='apache',
        description=
        'Id of the execution environment where the agent instance is installed.',
        validate=In.apply(Exec_Env_Document.get_ids),
        error_messages=In.error_messages)
    status = Str(enum=AGENT_STATUS,
                 required=True,
                 readonly=True,
                 example=AGENT_STATUS[0],
                 description='Status of the agent.')
    operations = Nested(Agent_Instance_Operation_Schema,
                        many=True,
                        unknown='INCLUDE',
                        description='List of agent instance operations.')
    description = Str(
        example='Collect system metrics from execution environments.',
        description=
        'Short description of the agent installed in the execution environment.'
    )
Exemplo n.º 7
0
class Network_Link_Schema(Base_Schema):
    """Represents a network link."""

    doc = Network_Link_Document
    id = Str(required=True,
             example='net-link-1',
             description='Id of the network link.')
    type_id = Str(required=True,
                  example='pnt2pnt',
                  description='Id of the network link type.',
                  validate=In.apply(Network_Link_Type_Document.get_ids),
                  error_messages=In.error_messages)
    description = Str(
        example='Allow communication between front-end and back-end services.',
        description='Short description of the network link,')
Exemplo n.º 8
0
class Algorithm_Instance_Schema(Base_Schema):
    """Represents an algorithm instance."""

    doc = Algorithm_Instance_Document
    id = Str(required=True,
             example='ddos-predictor-1',
             description='Id of the algorithm instance.')
    algorithm_catalog_id = Str(
        required=True,
        readonly=True,
        example='ddos-predictor',
        description='Id of the algorithm in the catalog.',
        validate=In.apply(Algorithm_Catalog_Document.get_ids),
        error_messages=In.error_messages)
    operations = Nested(Algorithm_Instance_Operation_Schema,
                        many=True,
                        unknown='INCLUDE',
                        description='List of algorithm instance operations.')
    description = Str(
        example='Collect system metrics from execution environments.',
        description=
        'Short description of the algorithm installed in the execution environment.'
    )