示例#1
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')
示例#2
0
class Status_Response_Schema(Base_Schema):
    """Response for status endpoint."""

    id = Str(required=True, example='apache',
             description='ID of the execution environment.')
    started = Date_Time(format=FORMAT, required=True, example='2019/02/14 15:23:30',
                        description='Timestamp when the LCP is started')
    last_heartbeat = Date_Time(format=FORMAT, required=True, example='2019/02/14 15:23:33',
                               description='Timestamp of the expiration of the API access configuration.')
    username = Str(description='Username for the CB to connect to this LCP.')
    password = Str(description='Password for the CB to connect to this LCP.')
示例#3
0
class LCP_Schema(Schema):
    """Configuration of the LCP running in the execution environment."""

    port = Integer(
        required=True,
        example=5000,
        description='TCP port number of LCP in the execution environment.')
    started = Date_Time(readonly=True,
                        example='2019/02/14 15:23:30',
                        description='Timestamp when the LCP is started')
    last_heartbeat = Date_Time(
        reaonly=True,
        example='2019/02/14 15:23:33',
        description=
        'Timestamp of the expiration of the API access configuration.')
示例#4
0
class eBPF_Program_Instance_Parameter_Schema(Schema):
    """Parameter of the eBPF program instance installed in an execution environment."""

    id = Str(required=True, example='interface', description='Parameter id.')
    value = Raw(required=True, example='en0', description='Paremeter value.'),
    timestamp = Date_Time(
        format=FORMAT,
        readonly=True,
        description="Timestamp of the last time the parameter was set.")
示例#5
0
class Config_Response_Schema(Base_Schema):
    """Response for config endpoint."""

    id = Str(required=True, example='start', description='Config id.')
    data = Raw(description='Configuration data.')
    timestamp = Date_Time(format=FORMAT, required=True, description='Timestamp when the configuration is done.')
    type = Str(enum=RESPONSE_TYPES, example=RESPONSE_TYPES[0],
               description='Type of the response.', validate=validate.OneOf(RESPONSE_TYPES))
    error = Boolean(default=False, example=True, description='Indicate the presence of an error.')
示例#6
0
class LCP_Schema(Schema):
    """Configuration of the LCP running in the execution environment."""

    port = Integer(
        required=True,
        example=5000,
        description='TCP port number of LCP in the execution environment.')
    https = Boolean(required=True,
                    default=False,
                    example=True,
                    description='Communication with the LCP using HTTPS.')
    endpoint = Str(example='lcp',
                   description='URL Endpoint to connect with the LCP.')
    started = Date_Time(readonly=True,
                        example='2019/02/14 15:23:30',
                        description='Timestamp when the LCP is started')
    last_heartbeat = Date_Time(
        reaonly=True,
        example='2019/02/14 15:23:33',
        description=
        'Timestamp of the expiration of the API access configuration.')