EVerest API definition for session storage (consumer) 1.0.0

API for EVerest API clients to read and clear persistently stored session records.

Experimental. This API is exempt from the EVerest stability guarantees and the deprecation period; channels, operations and message payloads may change without further notice until it is promoted to stable.

Pagination. get_sessions returns records oldest first, one page per request. A reply carries a continuation_token if more matching records follow; pass it in the next request and iterate until a reply has no token. A page can hold fewer records than requested, in rare cases none, while still carrying a token. An invalid or outdated token starts the iteration from the beginning. The request payload is optional: an empty object requests the first page with the default page size. The started_after filter is compared at millisecond precision.

Deleting records. clear_sessions cannot be undone and also deletes records that are still open; when such a session finishes later, the finish is dropped. The payload is optional: an empty object deletes every stored record. To delete exactly the records already read, pass the session id of the last record received from get_sessions as up_to_session_id; that record and every older one are deleted, sessions that started in the meantime are kept.

Concurrent clients. Neither the bridge nor the store keeps per-client state, so several clients may use the API at the same time. A clear_sessions issued by one client while another is paging removes records from that iteration; the other client's token stays valid and resumes at the oldest surviving record. Clients sharing one store should coordinate clearing, or clear only what they have read via up_to_session_id.

Missing records. get_session replies with the JSON literal null when no stored record matches the identifier.

  • #EVerest
  • #SessionStorage

Servers

  • mqtt://localhost:1883/everest_api/1/session_storage_consumer/{module_id}mqttdefault

    default local MQTT

    object
    module_id
    required
    string

    The ID of the module as defined in the EVerest config file.

Operations

  • REQUEST m2e/get_sessions

    Direction: Module to EVerest. Request one page of stored session records, oldest first. Iterate by passing the continuation_token of a reply into the next request until a reply carries no token.

    Operation IDsend_request_get_sessions

    Available only on servers:

    Accepts the following message:

    Request one page of stored session recordssend_request_get_sessions

    Request one page of stored session records.

    Message IDsend_request_get_sessions
    object

    Examples

    REPLY INFORMATION

    REPLY CHANNEL INFORMATION

    Reply will be directed to the address specified at this location: $message.header#/replyTo

    REPLY address information

    REPLY will be sent to the address provided in:$message.header#/replyTo
  • RECEIVE

    Direction: EVerest to Module

    Operation IDreceive_reply_get_sessions

    Available only on servers:

    Accepts the following message:

    One page of stored session recordsreceive_reply_get_sessions

    Reply to the request to send one page of stored session records

    Message IDreceive_reply_get_sessions
    object

    One page of stored session records

    Examples

  • REQUEST m2e/get_session

    Direction: Module to EVerest. Request one session record, identified either by its session id or by its OCPP transaction id. The reply will be sent to the replyTo address specified in the message headers. If no record matches the identifier, a null payload will be sent.

    Operation IDsend_request_get_session

    Available only on servers:

    Accepts the following message:

    Request a single stored session recordsend_request_get_session

    Request the session record matching the given identifier.

    Message IDsend_request_get_session
    object

    Examples

    REPLY INFORMATION

    REPLY CHANNEL INFORMATION

    Reply will be directed to the address specified at this location: $message.header#/replyTo

    REPLY address information

    REPLY will be sent to the address provided in:$message.header#/replyTo
  • RECEIVE

    Direction: EVerest to Module

    Operation IDreceive_reply_get_session

    Available only on servers:

    Accepts the following message:

    A single stored session recordreceive_reply_get_session

    Reply to the request to send a single session record. Null if no record matches the identifier.

    Message IDreceive_reply_get_session
    oneOf

    Examples

  • REQUEST m2e/clear_sessions

    Direction: Module to EVerest. Deletes stored session records, including records that are still open. An absent payload deletes every record, up_to_session_id limits the deletion to that record and the records stored before it. This cannot be undone. When a deleted open session finishes later, the finish is dropped and the record does not reappear.

    Operation IDsend_request_clear_sessions

    Available only on servers:

    Accepts the following message:

    Request deletion of stored session recordssend_request_clear_sessions

    Delete all stored session records, or the records up to a given one.

    Message IDsend_request_clear_sessions
    object

    Examples

    REPLY INFORMATION

    REPLY CHANNEL INFORMATION

    Reply will be directed to the address specified at this location: $message.header#/replyTo

    REPLY address information

    REPLY will be sent to the address provided in:$message.header#/replyTo
  • RECEIVE

    Direction: EVerest to Module

    Operation IDreceive_reply_clear_sessions

    Available only on servers:

    Accepts the following message:

    Result of deleting stored session recordsreceive_reply_clear_sessions

    Reply to the request to delete stored session records

    Message IDreceive_reply_clear_sessions
    object

    Result of deleting stored session records

    Examples

  • RECEIVE e2m/heartbeat

    Operation IDreceive_heartbeat

    Available only on servers:

    Accepts the following message:

    Receive heartbeatreceive_heartbeat

    Heartbeat produced by EVerest as configured via cfg_heartbeat_interval_ms in the EVerest configuration

    Message IDreceive_heartbeat
    Payload
    integer

    64bit unsigned integer. The id of every heartbeat increases by 1 and overflows when the maximum representable value is reached

    Examples

  • SEND m2e/communication_check

    Operation IDsend_communication_check

    Available only on servers:

    Accepts the following message:

    Send communication checksend_communication_check

    Signal to EVerest that communication is good or check shall be stopped

    Message IDsend_communication_check
    Payload
    boolean

    Send 'true' at least every 'cfg_communication_check_to_s' seconds to signal module is alive. Send 'false' to stop communication check'

    Examples

Messages

  • #1Request one page of stored session recordssend_request_get_sessions

    Request one page of stored session records.

    Message IDsend_request_get_sessions
    object
  • #2One page of stored session recordsreceive_reply_get_sessions

    Reply to the request to send one page of stored session records

    Message IDreceive_reply_get_sessions
    object

    One page of stored session records

  • #3Request a single stored session recordsend_request_get_session

    Request the session record matching the given identifier.

    Message IDsend_request_get_session
    object
  • #4A single stored session recordreceive_reply_get_session

    Reply to the request to send a single session record. Null if no record matches the identifier.

    Message IDreceive_reply_get_session
    oneOf
  • #5Request deletion of stored session recordssend_request_clear_sessions

    Delete all stored session records, or the records up to a given one.

    Message IDsend_request_clear_sessions
    object
  • #6Result of deleting stored session recordsreceive_reply_clear_sessions

    Reply to the request to delete stored session records

    Message IDreceive_reply_clear_sessions
    object

    Result of deleting stored session records

  • #7Receive heartbeatreceive_heartbeat

    Heartbeat produced by EVerest as configured via cfg_heartbeat_interval_ms in the EVerest configuration

    Message IDreceive_heartbeat
    Payload
    integer

    64bit unsigned integer. The id of every heartbeat increases by 1 and overflows when the maximum representable value is reached

  • #8Send communication checksend_communication_check

    Signal to EVerest that communication is good or check shall be stopped

    Message IDsend_communication_check
    Payload
    boolean

    Send 'true' at least every 'cfg_communication_check_to_s' seconds to signal module is alive. Send 'false' to stop communication check'

Schemas

  • object

    Criteria a session record must match to be returned

  • object

    Page request for stored session records. An empty object requests the first page of all records with the default page size.

  • object

    One page of stored session records

  • object

    One persistently stored session record. A record is created when the session starts and completed when it finishes, so the fields that are only known at the end of a session are absent while the record is open.

  • object

    The transaction charged within a session. It starts at the point where all preconditions for charging are met and finishes when one of them irrevocably becomes false, so the fields that are only known at the end of a transaction are absent while it is running.

  • SessionState
    string

    Lifecycle state of a stored session record

    • Open: The session is ongoing.
    • Finished: The session finished. Sessions with a running transaction that were interrupted by a power cycle are also closed by the module during recovery on the next boot, in which case the transaction carries stop reason PowerLoss and the session stop timestamp is the time of the recovery.
    • Stale: The session never finished and never will. A newer session was started on the same EVSE while this record was still Open, which means tracking of this one was lost, for example in a crash or a power cycle during a session without a running transaction.
      Allowed values:
    • "Open"
    • "Finished"
    • "Stale"
  • object

    Identifies a single session record. Exactly one of the members must be set. If both are set, session_id takes precedence.

  • object

    Selects the session records to delete. An empty object deletes every stored record.

  • object

    Result of deleting stored session records

  • CommunicationCheck
    boolean

    Send 'true' at least every 'cfg_communication_check_to_s' seconds to signal module is alive. Send 'false' to stop communication check'

  • HeartBeatId
    integer

    64bit unsigned integer. The id of every heartbeat increases by 1 and overflows when the maximum representable value is reached