Skip to content

Commit

Permalink
Merge pull request #41 from fabric-testbed/rel1.7
Browse files Browse the repository at this point in the history
Rel1.7 - changes
  • Loading branch information
kthare10 authored Jul 18, 2024
2 parents c145733 + be48d50 commit 1c5590a
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 11 deletions.
2 changes: 1 addition & 1 deletion fabric_mb/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.6.2"
__version__ = "1.7.0rc0"
1 change: 0 additions & 1 deletion fabric_mb/message_bus/messages/lease_reservation_avro.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import pickle
from typing import List

from fabric_mb.message_bus.message_bus_exception import MessageBusException
from fabric_mb.message_bus.messages.constants import Constants
from fabric_mb.message_bus.messages.reservation_predecessor_avro import ReservationPredecessorAvro
from fabric_mb.message_bus.messages.ticket_reservation_avro import TicketReservationAvro
Expand Down
34 changes: 34 additions & 0 deletions fabric_mb/message_bus/messages/request_by_id_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#
# Author: Komal Thareja ([email protected])
from typing import List
from datetime import datetime, timezone

from fabric_mb.message_bus.messages.abc_message_avro import AbcMessageAvro

Expand Down Expand Up @@ -52,6 +53,10 @@ def __init__(self):
self.graph_format = None
self.site = None
self.states = None
self.start = None
self.end = None
self.ip_subnet = None
self.host = None

def get_slice_id(self) -> str:
"""
Expand Down Expand Up @@ -148,3 +153,32 @@ def validate(self) -> bool:
ret_val = False

return ret_val

def set_end(self, end: datetime):
if end is not None:
self.end = int(end.timestamp())

def set_start(self, start: datetime):
if start is not None:
self.start = int(start.timestamp())

def get_end(self) -> datetime:
if self.end is not None:
return datetime.fromtimestamp(self.end, tz=timezone.utc)

def get_start(self) -> datetime:
if self.start is not None:
return datetime.fromtimestamp(self.start, tz=timezone.utc)

def set_ip_subnet(self, ip_subnet: str):
self.ip_subnet = ip_subnet

def get_ip_subnet(self) -> str:
return self.ip_subnet

def set_host(self, host: str):
self.host = host

def get_host(self) -> str:
return self.host

20 changes: 20 additions & 0 deletions fabric_mb/message_bus/schema/message.avsc
Original file line number Diff line number Diff line change
Expand Up @@ -1196,6 +1196,26 @@
"name": "site",
"type": ["null", "string"],
"default": null
},
{
"name": "start",
"type": ["null", "string"],
"default": null
},
{
"name": "end",
"type": ["null", "string"],
"default": null
},
{
"name": "ip_subnet",
"type": ["null", "string"],
"default": null
},
{
"name": "host",
"type": ["null", "string"],
"default": null
}
]
},
Expand Down
Loading

0 comments on commit 1c5590a

Please sign in to comment.