Skip to content

frequenz.api.dispatch.v1.dispatch_pb2 ¤

Generated protocol buffer code.

Classes¤

frequenz.api.dispatch.v1.dispatch_pb2.ComponentIDs ¤

Bases: Message

Wrapper for controlling dispatches with a set of component IDs

Attributes¤
component_ids property ¤
component_ids: RepeatedScalarFieldContainer[int]

Set of component IDs

frequenz.api.dispatch.v1.dispatch_pb2.ComponentSelector ¤

Bases: Message

Parameter for controlling which components a dispatch applies to Either a set of component IDs, or all components belonging to a category

Attributes¤
component_category instance-attribute ¤
component_category: ValueType

Component category

component_ids property ¤
component_ids: global___ComponentIDs

Set of component IDs

frequenz.api.dispatch.v1.dispatch_pb2.Dispatch ¤

Bases: Message

Message representing one dispatch.

Timezone Note: Timestamps are in UTC. It is the responsibility of each microgrid to translate UTC to its local timezone.

Source code in frequenz/api/dispatch/v1/dispatch_pb2.py
  _globals['_COMPONENTSELECTOR']._serialized_start=896
  _globals['_COMPONENTSELECTOR']._serialized_end=1086
  _globals['_COMPONENTIDS']._serialized_start=1088
  _globals['_COMPONENTIDS']._serialized_end=1125
  _globals['_RECURRENCERULE']._serialized_start=1128
  _globals['_RECURRENCERULE']._serialized_end=1882
  _globals['_RECURRENCERULE_ENDCRITERIA']._serialized_start=1451
  _globals['_RECURRENCERULE_ENDCRITERIA']._serialized_end=1544
  _globals['_RECURRENCERULE_WEEKDAY']._serialized_start=1547
  _globals['_RECURRENCERULE_WEEKDAY']._serialized_end=1729
  _globals['_RECURRENCERULE_FREQUENCY']._serialized_start=1732
  _globals['_RECURRENCERULE_FREQUENCY']._serialized_end=1882
  _globals['_DISPATCHLISTREQUEST']._serialized_start=1884
  _globals['_DISPATCHLISTREQUEST']._serialized_end=1985
  _globals['_DISPATCHFILTER']._serialized_start=1988
  _globals['_DISPATCHFILTER']._serialized_end=2215
  _globals['_DISPATCHLIST']._serialized_start=2217
  _globals['_DISPATCHLIST']._serialized_end=2287
  _globals['_DISPATCHCREATEREQUEST']._serialized_start=2290
  _globals['_DISPATCHCREATEREQUEST']._serialized_end=2621
  _globals['_DISPATCHUPDATEREQUEST']._serialized_start=2624
  _globals['_DISPATCHUPDATEREQUEST']._serialized_end=3569
  _globals['_DISPATCHUPDATEREQUEST_DISPATCHUPDATE']._serialized_start=2791
  _globals['_DISPATCHUPDATEREQUEST_DISPATCHUPDATE']._serialized_end=3569
  _globals['_DISPATCHUPDATEREQUEST_DISPATCHUPDATE_RECURRENCERULEUPDATE']._serialized_start=3159
  _globals['_DISPATCHUPDATEREQUEST_DISPATCHUPDATE_RECURRENCERULEUPDATE']._serialized_end=3518
  _globals['_DISPATCHGETREQUEST']._serialized_start=3571
  _globals['_DISPATCHGETREQUEST']._serialized_end=3603
  _globals['_DISPATCHDELETEREQUEST']._serialized_start=3605
  _globals['_DISPATCHDELETEREQUEST']._serialized_end=3640
  _globals['_MICROGRIDDISPATCHSERVICE']._serialized_start=3643
  _globals['_MICROGRIDDISPATCHSERVICE']._serialized_end=4189
# @@protoc_insertion_point(module_scope)
Attributes¤
create_time property ¤
create_time: Timestamp

The creation time in UTC This is set when a dispatch is created via the create request message

duration instance-attribute ¤
duration: int

Duration in seconds

id instance-attribute ¤
id: int

The dispatch identifier

is_active instance-attribute ¤
is_active: bool

The "active" status An active dispatch is eligible for processing, either immediately or at a scheduled time in the future, including recurring dispatches. If a dispatch is set to inactive, it won't be processed even if it matches all other conditions, allowing for temporary disabling of dispatches without deletion.

is_dry_run instance-attribute ¤
is_dry_run: bool

The "dry run" status A dry run dispatch is executed for logging and monitoring purposes without affecting the microgrid components. This is useful, for example, in scenarios where a user may want to test dispatch behavior without actually affecting any component states. Notably, a dispatch can be both "dry run" and "active," allowing for the system to generate logs and observe behavior without making actual changes.

microgrid_id instance-attribute ¤
microgrid_id: int

The microgrid identifier

payload property ¤
payload: Struct

The dispatch payload

recurrence property ¤
recurrence: global___RecurrenceRule

The recurrence rule

selector property ¤
selector: global___ComponentSelector

The component selector

start_time property ¤
start_time: Timestamp

The start time in UTC

type instance-attribute ¤
type: str

The dispatch type. Contains user-defined information about what "type" of dispatch this is. Downstream applications that consume the dispatch API are responsible for understanding and processing this field.

update_time property ¤
update_time: Timestamp

The update time in UTC This is set when a dispatch is modified via the update request message

frequenz.api.dispatch.v1.dispatch_pb2.DispatchCreateRequest ¤

Bases: Message

Message to create a new dispatch with the given attributes

Attributes¤
duration instance-attribute ¤
duration: int

Duration in seconds

is_active instance-attribute ¤
is_active: bool

The "active" status

is_dry_run instance-attribute ¤
is_dry_run: bool

The "dry run" status

microgrid_id instance-attribute ¤
microgrid_id: int

The microgrid identifier

payload property ¤
payload: Struct

The dispatch payload

recurrence property ¤
recurrence: global___RecurrenceRule

The recurrence rule

selector property ¤
selector: global___ComponentSelector

The component selector

start_time property ¤
start_time: Timestamp

The start time When creating a dispatch, ensure that the starting timestamp is set to the current time or any future time. Timestamps earlier than the current time are not allowed.

type instance-attribute ¤
type: str

The type of dispatch

frequenz.api.dispatch.v1.dispatch_pb2.DispatchDeleteRequest ¤

Bases: Message

Message to delete a single dispatch by its ID

Attributes¤
id instance-attribute ¤
id: int

The dispatch identifier

frequenz.api.dispatch.v1.dispatch_pb2.DispatchFilter ¤

Bases: Message

Parameters for filtering the dispatch list

Attributes¤
is_active instance-attribute ¤
is_active: bool

Filter by active status If this field is not set, dispatches of any active status will be included.

is_dry_run instance-attribute ¤
is_dry_run: bool

Filter by dry run status If this field is not set, dispatches of any dry run status will be included.

selectors property ¤
selectors: RepeatedCompositeFieldContainer[
    global___ComponentSelector
]

Filter by component ID or category

time_interval property ¤
time_interval: global___TimeIntervalFilter

Filter by time interval If no interval is provided, all dispatches starting from the current timestamp will be included.

frequenz.api.dispatch.v1.dispatch_pb2.DispatchGetRequest ¤

Bases: Message

Message to get a single dispatch by its ID

Attributes¤
id instance-attribute ¤
id: int

The dispatch identifier

frequenz.api.dispatch.v1.dispatch_pb2.DispatchList ¤

Bases: Message

A list of dispatches

Attributes¤
dispatches property ¤
dispatches: RepeatedCompositeFieldContainer[
    global___Dispatch
]

The dispatches

frequenz.api.dispatch.v1.dispatch_pb2.DispatchListRequest ¤

Bases: Message

Message for listing dispatches for a given microgrid, and an optional filter

Attributes¤
filter property ¤
filter: global___DispatchFilter

Additional filter parameters

microgrid_id instance-attribute ¤
microgrid_id: int

The microgrid ID

frequenz.api.dispatch.v1.dispatch_pb2.DispatchUpdateRequest ¤

Bases: Message

Message to update the dispatch with the given ID, with the given attributes

Attributes¤
id instance-attribute ¤
id: int

The dispatch identifier

update property ¤
update: DispatchUpdate

The updated dispatch attributes

update_mask property ¤
update_mask: FieldMask

Field mask specifying which fields should be updated

Classes¤
DispatchUpdate ¤

Bases: Message

Message containing the updated dispatch attributes

Attributes¤
duration instance-attribute ¤
duration: int

Duration in seconds

is_active instance-attribute ¤
is_active: bool

The "active" status

is_dry_run instance-attribute ¤
is_dry_run: bool

The "dry run" status

payload property ¤
payload: Struct

The dispatch payload

recurrence property ¤
recurrence: RecurrenceRuleUpdate

The recurrence rule

selector property ¤
selector: global___ComponentSelector

The component selector

start_time property ¤
start_time: Timestamp

The start time When updating a dispatch, ensure that the starting timestamp is set to the current time or any future time. Timestamps earlier than the current time are not allowed.

type instance-attribute ¤
type: str

The type of dispatch

Classes¤
RecurrenceRuleUpdate ¤

Bases: Message

Message containing the updated recurrence rule attributes

Attributes¤
byhours property ¤
byhours: RepeatedScalarFieldContainer[int]

On which hour(s) of the day does the event occur

byminutes property ¤
byminutes: RepeatedScalarFieldContainer[int]

On which minute(s) of the hour does the event occur

bymonthdays property ¤
bymonthdays: RepeatedScalarFieldContainer[int]

On which day(s) of the month does the event occur

bymonths property ¤
bymonths: RepeatedScalarFieldContainer[int]

On which month(s) of the year does the event occur

byweekdays property ¤
byweekdays: RepeatedScalarFieldContainer[ValueType]

On which day(s) of the week does the event occur

end_criteria property ¤
end_criteria: EndCriteria

When this dispatch should end.

freq instance-attribute ¤
freq: ValueType

The frequency specifier of this recurring dispatch

interval instance-attribute ¤
interval: int

How often this dispatch should recur, based on the frequency

frequenz.api.dispatch.v1.dispatch_pb2.RecurrenceRule ¤

Bases: Message

Ruleset governing when and how a dispatch should re-occur.

Timezone Note: Timestamps are in UTC. It is the responsibility of each microgrid to translate UTC to its local timezone.

This definition tries to adhere closely to the iCalendar specification (RFC5545), particularly for recurrence rules. For advanced use-cases or further clarifications, refer to RFC5545.

Examples¤
Every 6 months¤
message RecurrenceRule {
  Frequency freq = FREQUENCY_MONTHLY;
  uint32 interval = 6;
}
Weekends only¤
message RecurrenceRule {
  Frequency freq = FREQUENCY_WEEKLY;
  repeated Weekday byweekdays = [WEEKDAY_SATURDAY, WEEKDAY_SUNDAY];
}
At midnight¤

Every day at midnight.

message RecurrenceRule {
  Frequency freq = FREQUENCY_DAILY;
  repeated uint32 byhours = [0];
}
Nightly¤

Assuming "night" means from 8 PM to 6 AM.

message RecurrenceRule {
  Frequency freq = FREQUENCY_DAILY;
  repeated uint32 byhours = [20, 21, 22, 23, 0, 1, 2, 3, 4, 5];
}
Attributes¤
byhours property ¤
byhours: RepeatedScalarFieldContainer[int]

On which hour(s) of the day does the event occur

byminutes property ¤
byminutes: RepeatedScalarFieldContainer[int]

On which minute(s) of the hour does the event occur

bymonthdays property ¤
bymonthdays: RepeatedScalarFieldContainer[int]

On which day(s) of the month does the event occur

bymonths property ¤
bymonths: RepeatedScalarFieldContainer[int]

On which month(s) of the year does the event occur

byweekdays property ¤
byweekdays: RepeatedScalarFieldContainer[ValueType]

On which day(s) of the week does the event occur

end_criteria property ¤
end_criteria: EndCriteria

When this dispatch should end. A dispatch can either recur a fixed number of times, or until a given timestamp. If this field is not set, the dispatch will recur indefinitely.bool

freq instance-attribute ¤
freq: ValueType

The frequency specifier of this recurring dispatch

interval instance-attribute ¤
interval: int

How often this dispatch should recur, based on the frequency Example: - Every 2 hours: freq = FREQUENCY_HOURLY interval = 2

Classes¤
EndCriteria ¤

Bases: Message

Controls when a recurring dispatch should end

Attributes¤
count instance-attribute ¤
count: int

The number of times this dispatch should recur. If this field is set, the dispatch will recur the given number of times.

until property ¤
until: Timestamp

The end time of this dispatch in UTC. If this field is set, the dispatch will recur until the given timestamp.

Frequency ¤

Bases: _Frequency

Enum representing the frequency of the recurrence

Weekday ¤

Bases: _Weekday

Enum representing the day of the week

frequenz.api.dispatch.v1.dispatch_pb2.TimeIntervalFilter ¤

Bases: Message

Filter parameter for specifying multiple time intervals

Attributes¤
end_from property ¤
end_from: Timestamp

Filter by recurrence.end_criteria.until >= this timestamp

end_to property ¤
end_to: Timestamp

Filter by recurrence.end_criteria.until < this timestamp

start_from property ¤
start_from: Timestamp

Filter by start_time >= this timestamp

start_to property ¤
start_to: Timestamp

Filter by start_time < this timestamp