movai_core_shared.messages package

Submodules

movai_core_shared.messages.alert_data module

Copyright (C) Mov.ai - All Rights Reserved Unauthorized copying of this file, via any medium is strictly prohibited Proprietary and confidential

Developers: - Erez Zomer (erez@mov.ai) - 2023

class movai_core_shared.messages.alert_data.AlertActivationData(*, args: str | None, activation_date: str)

Bases: BaseModel

activation_date: str
args: str | None
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'activation_date': FieldInfo(annotation=str, required=True), 'args': FieldInfo(annotation=Union[str, NoneType], required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class movai_core_shared.messages.alert_data.AlertData(*, deactivation_date: str, deactivation_type: Literal['requested'] | Literal['auto_cleared'], args: str | None, activation_date: str, alert_id: str)

Bases: AlertActivationData, AlertDeactivationData

alert_id: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'activation_date': FieldInfo(annotation=str, required=True), 'alert_id': FieldInfo(annotation=str, required=True), 'args': FieldInfo(annotation=Union[str, NoneType], required=True), 'deactivation_date': FieldInfo(annotation=str, required=True), 'deactivation_type': FieldInfo(annotation=Union[Literal['requested'], Literal['auto_cleared']], required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class movai_core_shared.messages.alert_data.AlertDeactivationData(*, deactivation_date: str, deactivation_type: Literal['requested'] | Literal['auto_cleared'])

Bases: BaseModel

deactivation_date: str
deactivation_type: Literal['requested'] | Literal['auto_cleared']
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'deactivation_date': FieldInfo(annotation=str, required=True), 'deactivation_type': FieldInfo(annotation=Union[Literal['requested'], Literal['auto_cleared']], required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

movai_core_shared.messages.command_data module

Command data message definition.

class movai_core_shared.messages.command_data.Command(*, command_data: CommandData, dst: Destination)

Bases: BaseModel

command_data: CommandData
dst: Destination
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'command_data': FieldInfo(annotation=CommandData, required=True), 'dst': FieldInfo(annotation=Destination, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class movai_core_shared.messages.command_data.CommandData(*, command: str, flow: str | None = '', node: str | None = '', port: str | None = '', data: dict | None = {})

Bases: BaseModel

command: str
data: dict | None
flow: str | None
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'command': FieldInfo(annotation=str, required=True), 'data': FieldInfo(annotation=Union[dict, NoneType], required=False, default={}), 'flow': FieldInfo(annotation=Union[str, NoneType], required=False, default=''), 'node': FieldInfo(annotation=Union[str, NoneType], required=False, default=''), 'port': FieldInfo(annotation=Union[str, NoneType], required=False, default='')}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

node: str | None
port: str | None
class movai_core_shared.messages.command_data.CommandReq(*, req_id: str | None = None, req_type: str, created: int, response_required: bool, robot_info: RobotInfo, req_data: Command)

Bases: Request

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'created': FieldInfo(annotation=int, required=True), 'req_data': FieldInfo(annotation=Command, required=True), 'req_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'req_type': FieldInfo(annotation=str, required=True), 'response_required': FieldInfo(annotation=bool, required=True), 'robot_info': FieldInfo(annotation=RobotInfo, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

req_data: Command
class movai_core_shared.messages.command_data.Destination(*, ip: str, host: str, id: str)

Bases: BaseModel

host: str
id: str
ip: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'host': FieldInfo(annotation=str, required=True), 'id': FieldInfo(annotation=str, required=True), 'ip': FieldInfo(annotation=str, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

movai_core_shared.messages.email_data module

Copyright (C) Mov.ai - All Rights Reserved Unauthorized copying of this file, via any medium is strictly prohibited Proprietary and confidential

Developers: - Moawiya Mograbi (moawiya@mov.ai) - 2023

class movai_core_shared.messages.email_data.EmailData(*, recipients: List[EmailStr], notification_type: str = 'smtp', subject: str | None = None, body: str, attachment_data: str | None = None, sender: str = 'UNDEFINED_ROBOT_NAME movai')

Bases: BaseModel

a base dataclass based on pydantic basemodel in order to support validation and check for missing fields or wrong values.

attachment_data: str | None
body: str
model_config: ClassVar[ConfigDict] = {'frozen': False}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'attachment_data': FieldInfo(annotation=Union[str, NoneType], required=False), 'body': FieldInfo(annotation=str, required=True), 'notification_type': FieldInfo(annotation=str, required=False, default='smtp'), 'recipients': FieldInfo(annotation=List[pydantic.networks.EmailStr], required=True), 'sender': FieldInfo(annotation=str, required=False, default='UNDEFINED_ROBOT_NAME movai'), 'subject': FieldInfo(annotation=Union[str, NoneType], required=False)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

notification_type: str
classmethod notification_type_valid(value)

Validates the notification_type field

Parameters:

value (str) – Which notification to use.

Raises:

ValueError – In case notification is diffenrent from smtp.

Returns:

The given value.

Return type:

str

recipients: List[EmailStr]
sender: str
subject: str | None

movai_core_shared.messages.general_data module

Copyright (C) Mov.ai - All Rights Reserved Unauthorized copying of this file, via any medium is strictly prohibited Proprietary and confidential

Developers: - Erez Zomer (erez@mov.ai) - 2023

class movai_core_shared.messages.general_data.Request(*, req_id: str | None = None, req_type: str, created: int, response_required: bool, robot_info: RobotInfo)

Bases: BaseModel

created: int
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'created': FieldInfo(annotation=int, required=True), 'req_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'req_type': FieldInfo(annotation=str, required=True), 'response_required': FieldInfo(annotation=bool, required=True), 'robot_info': FieldInfo(annotation=RobotInfo, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

req_id: str | None
req_type: str
response_required: bool
robot_info: RobotInfo
class movai_core_shared.messages.general_data.RobotInfo(*, fleet: str, robot: str, service: str, id: str)

Bases: BaseModel

a base dataclass based on pydantic basemodel in order to support validation and check for missing fields or wrong values.

fleet: str
id: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'fleet': FieldInfo(annotation=str, required=True), 'id': FieldInfo(annotation=str, required=True), 'robot': FieldInfo(annotation=str, required=True), 'service': FieldInfo(annotation=str, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

robot: str
service: str
movai_core_shared.messages.general_data.print_dict(message: dict, space_count: int)

movai_core_shared.messages.log_data module

Copyright (C) Mov.ai - All Rights Reserved Unauthorized copying of this file, via any medium is strictly prohibited Proprietary and confidential

Developers: - Erez Zomer (erez@mov.ai) - 2023

class movai_core_shared.messages.log_data.LogData(*, measurement: str, log_tags: LogTags, log_fields: LogFields)

Bases: BaseModel

log_fields: LogFields
log_tags: LogTags
measurement: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'log_fields': FieldInfo(annotation=LogFields, required=True), 'log_tags': FieldInfo(annotation=LogTags, required=True), 'measurement': FieldInfo(annotation=str, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class movai_core_shared.messages.log_data.LogFields(*, module: str, funcName: str, lineno: int, message: str, args: str | None = None)

Bases: BaseModel

args: str | None
format() str

Format log message.

Returns:

The formatted log message.

Return type:

str

funcName: str
lineno: int
message: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'args': FieldInfo(annotation=Union[str, NoneType], required=False), 'funcName': FieldInfo(annotation=str, required=True), 'lineno': FieldInfo(annotation=int, required=True), 'message': FieldInfo(annotation=str, required=True), 'module': FieldInfo(annotation=str, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

module: str
class movai_core_shared.messages.log_data.LogRequest(*, req_id: str | None = None, req_type: str, created: int, response_required: bool, robot_info: RobotInfo, req_data: LogData)

Bases: Request

get_client_log_format() dict

Returns a dict with the format used to send to frontend.

Returns:

A dictionary with the required fields.

Return type:

dict

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'created': FieldInfo(annotation=int, required=True), 'req_data': FieldInfo(annotation=LogData, required=True), 'req_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'req_type': FieldInfo(annotation=str, required=True), 'response_required': FieldInfo(annotation=bool, required=True), 'robot_info': FieldInfo(annotation=RobotInfo, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

req_data: LogData
class movai_core_shared.messages.log_data.LogTags(*, robot: str, level: str, service: str, runtime: bool = False, **extra_data: Any)

Bases: BaseModel

level: str
model_config: ClassVar[ConfigDict] = {'extra': 'allow'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'level': FieldInfo(annotation=str, required=True), 'robot': FieldInfo(annotation=str, required=True), 'runtime': FieldInfo(annotation=bool, required=False, default=False), 'service': FieldInfo(annotation=str, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

robot: str
runtime: bool
service: str
class movai_core_shared.messages.log_data.SyslogData(*, measurement: str, log_tags: SyslogTags, log_fields: SyslogFields)

Bases: BaseModel

log_fields: SyslogFields
log_tags: SyslogTags
measurement: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'log_fields': FieldInfo(annotation=SyslogFields, required=True), 'log_tags': FieldInfo(annotation=SyslogTags, required=True), 'measurement': FieldInfo(annotation=str, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class movai_core_shared.messages.log_data.SyslogFields(*, module: str, funcName: str, lineno: int, facility_code: int, message: str, procid: int, severity_code: int, timestamp: int, version: str)

Bases: BaseModel

facility_code: int
funcName: str
lineno: int
message: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'facility_code': FieldInfo(annotation=int, required=True), 'funcName': FieldInfo(annotation=str, required=True), 'lineno': FieldInfo(annotation=int, required=True), 'message': FieldInfo(annotation=str, required=True), 'module': FieldInfo(annotation=str, required=True), 'procid': FieldInfo(annotation=int, required=True), 'severity_code': FieldInfo(annotation=int, required=True), 'timestamp': FieldInfo(annotation=int, required=True), 'version': FieldInfo(annotation=str, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

module: str
procid: int
severity_code: int
timestamp: int
version: str
class movai_core_shared.messages.log_data.SyslogRequest(*, req_id: str | None = None, req_type: str, created: int, response_required: bool, robot_info: RobotInfo, req_data: SyslogData)

Bases: Request

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'created': FieldInfo(annotation=int, required=True), 'req_data': FieldInfo(annotation=SyslogData, required=True), 'req_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'req_type': FieldInfo(annotation=str, required=True), 'response_required': FieldInfo(annotation=bool, required=True), 'robot_info': FieldInfo(annotation=RobotInfo, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

req_data: SyslogData
class movai_core_shared.messages.log_data.SyslogTags(*, appname: str, facility: str, host: str, hostname: str, severity: str)

Bases: BaseModel

appname: str
facility: str
host: str
hostname: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'appname': FieldInfo(annotation=str, required=True), 'facility': FieldInfo(annotation=str, required=True), 'host': FieldInfo(annotation=str, required=True), 'hostname': FieldInfo(annotation=str, required=True), 'severity': FieldInfo(annotation=str, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

severity: str

movai_core_shared.messages.metric_data module

Copyright (C) Mov.ai - All Rights Reserved Unauthorized copying of this file, via any medium is strictly prohibited Proprietary and confidential

Developers: - Erez Zomer (erez@mov.ai) - 2023

class movai_core_shared.messages.metric_data.AlertQueryContent(*, time: int, activation_date: str, alert_id: str, args: str, deactivation_date: str, deactivation_type: str, fleet: str, id: str, robot: str, service: str)

Bases: BaseModel

activation_date: str
alert_id: str
args: str
deactivation_date: str
deactivation_type: str
fleet: str
id: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'activation_date': FieldInfo(annotation=str, required=True), 'alert_id': FieldInfo(annotation=str, required=True), 'args': FieldInfo(annotation=str, required=True), 'deactivation_date': FieldInfo(annotation=str, required=True), 'deactivation_type': FieldInfo(annotation=str, required=True), 'fleet': FieldInfo(annotation=str, required=True), 'id': FieldInfo(annotation=str, required=True), 'robot': FieldInfo(annotation=str, required=True), 'service': FieldInfo(annotation=str, required=True), 'time': FieldInfo(annotation=int, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

robot: str
service: str
time: int
class movai_core_shared.messages.metric_data.AlertQueryData(*, limit: int, offset: int, count: int, data: List[AlertQueryContent])

Bases: BaseModel

count: int
data: List[AlertQueryContent]
limit: int
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'count': FieldInfo(annotation=int, required=True), 'data': FieldInfo(annotation=List[movai_core_shared.messages.metric_data.AlertQueryContent], required=True), 'limit': FieldInfo(annotation=int, required=True), 'offset': FieldInfo(annotation=int, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

offset: int
class movai_core_shared.messages.metric_data.AlertQueryResponse(*, success: bool, error: str | None = None, reason: str | None = None, results: AlertQueryData)

Bases: GenericQueryResponse

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'error': FieldInfo(annotation=Union[str, NoneType], required=False), 'reason': FieldInfo(annotation=Union[str, NoneType], required=False), 'results': FieldInfo(annotation=AlertQueryData, required=True), 'success': FieldInfo(annotation=bool, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

results: AlertQueryData
class movai_core_shared.messages.metric_data.GenericQueryResponse(*, success: bool, error: str | None = None, reason: str | None = None)

Bases: BaseModel

Respone for MetricQueryRequest.

success

Indicates if the query was successful.

Type:

bool

results

The results of the query.

Type:

dict

error

Error message if the query failed.

Type:

Optional[str]

reason

Reason for failure, if applicable.

Type:

Optional[str]

error: str | None
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'error': FieldInfo(annotation=Union[str, NoneType], required=False), 'reason': FieldInfo(annotation=Union[str, NoneType], required=False), 'success': FieldInfo(annotation=bool, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

reason: str | None
success: bool
class movai_core_shared.messages.metric_data.LogQueryContent(*, robot: str, level: str, service: str, runtime: bool = False, module: str, funcName: str, lineno: int, message: str, args: str | None = None, time: int, **extra_data: Any)

Bases: LogFields, LogTags

model_config: ClassVar[ConfigDict] = {'extra': 'allow'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'args': FieldInfo(annotation=Union[str, NoneType], required=False), 'funcName': FieldInfo(annotation=str, required=True), 'level': FieldInfo(annotation=str, required=True), 'lineno': FieldInfo(annotation=int, required=True), 'message': FieldInfo(annotation=str, required=True), 'module': FieldInfo(annotation=str, required=True), 'robot': FieldInfo(annotation=str, required=True), 'runtime': FieldInfo(annotation=bool, required=False, default=False), 'service': FieldInfo(annotation=str, required=True), 'time': FieldInfo(annotation=int, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

time: int
class movai_core_shared.messages.metric_data.LogQueryData(*, limit: int, offset: int, count: int, data: List[LogQueryContent])

Bases: BaseModel

count: int
data: List[LogQueryContent]
limit: int
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'count': FieldInfo(annotation=int, required=True), 'data': FieldInfo(annotation=List[movai_core_shared.messages.metric_data.LogQueryContent], required=True), 'limit': FieldInfo(annotation=int, required=True), 'offset': FieldInfo(annotation=int, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

offset: int
class movai_core_shared.messages.metric_data.LogQueryResponse(*, success: bool, error: str | None = None, reason: str | None = None, results: LogQueryData)

Bases: GenericQueryResponse

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'error': FieldInfo(annotation=Union[str, NoneType], required=False), 'reason': FieldInfo(annotation=Union[str, NoneType], required=False), 'results': FieldInfo(annotation=LogQueryData, required=True), 'success': FieldInfo(annotation=bool, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

results: LogQueryData
class movai_core_shared.messages.metric_data.MetricData(*, measurement: str, db_name: Literal[typing.Literal['metrics'], typing.Literal['platform_metrics'], typing.Literal['platform_alerts']] = 'metrics', metric_fields: dict | None = None, metric_tags: dict | None = None)

Bases: BaseModel

Metrics data.

measurement

The name of the measurement.

Type:

str

db_name

The database name.

Type:

Literal[METRICS_INFLUX_DB, PLATFORM_METRICS_INFLUX_DB]

metric_fields

Measurement fields.

Type:

Optional[dict]

metric_tags

Measurement tags.

Type:

Optional[dict]

db_name: Literal[typing.Literal['metrics'], typing.Literal['platform_metrics'], typing.Literal['platform_alerts']]
measurement: str
metric_fields: dict | None
metric_tags: dict | None
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'db_name': FieldInfo(annotation=Literal[Literal['metrics'], Literal['platform_metrics'], Literal['platform_alerts']], required=False, default='metrics'), 'measurement': FieldInfo(annotation=str, required=True), 'metric_fields': FieldInfo(annotation=Union[dict, NoneType], required=False), 'metric_tags': FieldInfo(annotation=Union[dict, NoneType], required=False)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class movai_core_shared.messages.metric_data.MetricQueryData(*, measurement: str, query_data: QueryData, count_field: str | None = None, db_name: Literal[typing.Literal['logs'], typing.Literal['metrics'], typing.Literal['platform_metrics'], typing.Literal['platform_alerts']] = None)

Bases: BaseModel

count_field: str | None
db_name: Literal[typing.Literal['logs'], typing.Literal['metrics'], typing.Literal['platform_metrics'], typing.Literal['platform_alerts']]
measurement: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'count_field': FieldInfo(annotation=Union[str, NoneType], required=False), 'db_name': FieldInfo(annotation=Literal[Literal['logs'], Literal['metrics'], Literal['platform_metrics'], Literal['platform_alerts']], required=False), 'measurement': FieldInfo(annotation=str, required=True), 'query_data': FieldInfo(annotation=QueryData, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

query_data: QueryData
class movai_core_shared.messages.metric_data.MetricQueryRequest(*, req_id: str | None = None, req_type: str, created: int, response_required: bool, robot_info: RobotInfo, req_data: MetricQueryData)

Bases: Request

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'created': FieldInfo(annotation=int, required=True), 'req_data': FieldInfo(annotation=MetricQueryData, required=True), 'req_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'req_type': FieldInfo(annotation=str, required=True), 'response_required': FieldInfo(annotation=bool, required=True), 'robot_info': FieldInfo(annotation=RobotInfo, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

req_data: MetricQueryData
class movai_core_shared.messages.metric_data.MetricQueryResponse(*, success: bool, error: str | None = None, reason: str | None = None, results: dict)

Bases: GenericQueryResponse

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'error': FieldInfo(annotation=Union[str, NoneType], required=False), 'reason': FieldInfo(annotation=Union[str, NoneType], required=False), 'results': FieldInfo(annotation=dict, required=True), 'success': FieldInfo(annotation=bool, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

results: dict
class movai_core_shared.messages.metric_data.MetricRequest(*, req_id: str | None = None, req_type: str, created: int, response_required: bool, robot_info: RobotInfo, req_data: MetricData)

Bases: Request

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'created': FieldInfo(annotation=int, required=True), 'req_data': FieldInfo(annotation=MetricData, required=True), 'req_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'req_type': FieldInfo(annotation=str, required=True), 'response_required': FieldInfo(annotation=bool, required=True), 'robot_info': FieldInfo(annotation=RobotInfo, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

req_data: MetricData
class movai_core_shared.messages.metric_data.QueryData(*, fromDate: int | None = None, toDate: int | None = None, robot: str | None = None, level: str | None = None, service: str | None = None, tag: str | None = None, message: str | None = None, name: List[str] | None = None, limit: int, offset: int, order_by: str = 'time', order_dir: str = 'DESC')

Bases: BaseModel

fromDate: int | None
level: str | None
limit: int
message: str | None
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'fromDate': FieldInfo(annotation=Union[int, NoneType], required=False), 'level': FieldInfo(annotation=Union[str, NoneType], required=False), 'limit': FieldInfo(annotation=int, required=True), 'message': FieldInfo(annotation=Union[str, NoneType], required=False), 'name': FieldInfo(annotation=Union[List[str], NoneType], required=False), 'offset': FieldInfo(annotation=int, required=True), 'order_by': FieldInfo(annotation=str, required=False, default='time'), 'order_dir': FieldInfo(annotation=str, required=False, default='DESC'), 'robot': FieldInfo(annotation=Union[str, NoneType], required=False), 'service': FieldInfo(annotation=Union[str, NoneType], required=False), 'tag': FieldInfo(annotation=Union[str, NoneType], required=False), 'toDate': FieldInfo(annotation=Union[int, NoneType], required=False)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

name: List[str] | None
offset: int
order_by: str
order_dir: str
robot: str | None
service: str | None
tag: str | None
toDate: int | None

movai_core_shared.messages.notification_data module

Copyright (C) Mov.ai - All Rights Reserved Unauthorized copying of this file, via any medium is strictly prohibited Proprietary and confidential

Developers: - Moawiya Mograbi (moawiya@mov.ai) - 2023

class movai_core_shared.messages.notification_data.NotificationDataFactory

Bases: object

classmethod create(notification_type: str, notification_data: dict)

create an Object according to the type of the notification

Parameters:
  • notification_type (str) – the notificaiton type.

  • notification_data (dict) – the notification data.

Returns:

dataclass like obj representing the notification data

Return type:

Obj

movai_core_shared.messages.sms_data module

Copyright (C) Mov.ai - All Rights Reserved Unauthorized copying of this file, via any medium is strictly prohibited Proprietary and confidential

Developers: - Moawiya Mograbi (moawiya@mov.ai) - 2023

class movai_core_shared.messages.sms_data.SMSData(*, recipients: List[str], msg: str, notification_type: str)

Bases: BaseModel

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'msg': FieldInfo(annotation=str, required=True), 'notification_type': FieldInfo(annotation=str, required=True), 'recipients': FieldInfo(annotation=List[str], required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

msg: str
notification_type: str
recipients: List[str]

movai_core_shared.messages.stress_data module

movai_core_shared.messages.user_data module

Copyright (C) Mov.ai - All Rights Reserved Unauthorized copying of this file, via any medium is strictly prohibited Proprietary and confidential

Developers: - Moawiya Mograbi (moawiya@mov.ai) - 2023

class movai_core_shared.messages.user_data.UserData(*, notification_type: str = 'user', msg: str, robot_id: str, robot_name: str)

Bases: BaseModel

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'msg': FieldInfo(annotation=str, required=True), 'notification_type': FieldInfo(annotation=str, required=False, default='user'), 'robot_id': FieldInfo(annotation=str, required=True), 'robot_name': FieldInfo(annotation=str, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

msg: str
notification_type: str
robot_id: str
robot_name: str

Module contents

Copyright (C) Mov.ai - All Rights Reserved Unauthorized copying of this file, via any medium is strictly prohibited Proprietary and confidential

Developers: - Erez Zomer (erez@mov.ai) - 2023

class movai_core_shared.messages.NotificationDataFactory

Bases: object

classmethod create(notification_type: str, notification_data: dict)

create an Object according to the type of the notification

Parameters:
  • notification_type (str) – the notificaiton type.

  • notification_data (dict) – the notification data.

Returns:

dataclass like obj representing the notification data

Return type:

Obj