otupy.core.message.Message

class Message(content: Content, content_type: str = 'openc2', msg_type: MessageType = None, status: int = None, request_id: str = None, created: int = None, from_: str = None, to: [] = None, version: Version = '1.0', encoding: object = None)

Bases: object

OpenC2 Message

The Message class embeds all Message fields that are defined in Table 3.1 of the Language Specification. It is just an internal structure that is not automatically serialized, since the use of the fields depends on the specific transport protocol.

Methods

todict

Serialization to dictionary.

Attributes

content_type

Media Type that identifies the format of the content, including major version.

created

Creation date/time of the content.

encoding

Encoding format used to serialize the Message.

from_

Authenticated identifier of the creator of or authority for execution of a message.

msg_type

The type of OpenC2 Message.

request_id

A unique identifier created by the Producer and copied by Consumer into all Responses.

status

Populated with a numeric status code in Responses.

to

Authenticated identifier(s) of the authorized recipient(s) of a message.

version

OpenC2 version used to encode the Message.

content

Message body as specified by content_type and msg_type.

__init__(content: Content, content_type: str = 'openc2', msg_type: MessageType = None, status: int = None, request_id: str = None, created: int = None, from_: str = None, to: [] = None, version: Version = '1.0', encoding: object = None) None
content: Content

Message body as specified by content_type and msg_type.

content_type: str = 'openc2'

Media Type that identifies the format of the content, including major version.

created: int = None

Creation date/time of the content.

encoding: object = None

Encoding format used to serialize the Message.

This is is an additional field not envisioned by the Language Specification.

from_: str = None

Authenticated identifier of the creator of or authority for execution of a message.

This field is named from in the Specification.

msg_type: MessageType = None

The type of OpenC2 Message.

request_id: str = None

A unique identifier created by the Producer and copied by Consumer into all Responses.

status: int = None

Populated with a numeric status code in Responses.

to: [] = None

Authenticated identifier(s) of the authorized recipient(s) of a message.

todict()

Serialization to dictionary.

version: Version = '1.0'

OpenC2 version used to encode the Message.

This is is an additional field not envisioned by the Language Specification.