Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
e8186de
removal of scheduled_process entries from SQLite
ashish-jabble Sep 9, 2025
25fe983
external services scripts deleted
ashish-jabble Sep 9, 2025
d028fa7
get service installed API fixes for python based services
ashish-jabble Sep 9, 2025
e751877
add service API updates as per service info
ashish-jabble Sep 9, 2025
468d9ed
fledge status script updates
ashish-jabble Sep 11, 2025
1082484
service registry to accept any Type
ashish-jabble Sep 11, 2025
8a610f6
pipeline service type deletion from core
ashish-jabble Sep 12, 2025
8e8a68c
Service Record Type removal
ashish-jabble Sep 12, 2025
302c9ee
dispatcher service handling in core startup
ashish-jabble Sep 12, 2025
8ec829d
unit tests updated
ashish-jabble Sep 16, 2025
6c0bd3f
Schema version with 77 alongwith upgrade/downgrade scripts
ashish-jabble Sep 16, 2025
12ec6d1
service installed patch fixes in api tests
ashish-jabble Sep 16, 2025
be2c431
assertion fixes in service API tests
ashish-jabble Sep 16, 2025
644065b
Merge branch 'develop' into FOGL-10226
ashish-jabble Sep 16, 2025
a9ec685
Merge branch 'develop' into FOGL-10226
ashish-jabble Sep 19, 2025
aa7eba6
service type normalization in case of south, north only for backward …
ashish-jabble Sep 19, 2025
0ea458f
notification tests updated
ashish-jabble Sep 22, 2025
5b26f11
Updates as per FOGL-10225; removed pre inbuilt service core handling
ashish-jabble Sep 22, 2025
86eed03
Merge branch 'develop' into FOGL-10226
ashish-jabble Sep 25, 2025
b418f62
Merge branch 'develop' into FOGL-10226
ashish-jabble Oct 6, 2025
044db68
Merge branch 'develop' into FOGL-10226
ashish-jabble Nov 4, 2025
c9bf33f
Merge branch 'develop' into FOGL-10226
ashish-jabble Nov 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,6 @@ STORAGE_SERVICE_SCRIPT_SRC := scripts/services/storage
STORAGE_SCRIPT_SRC := scripts/storage
NORTH_C_SCRIPT_SRC := scripts/tasks/north_c
NORTH_SERVICE_C_SCRIPT_SRC := scripts/services/north_C
NOTIFICATION_C_SCRIPT_SRC := scripts/services/notification_c
DISPATCHER_C_SCRIPT_SRC := scripts/services/dispatcher_c
BUCKET_STORAGE_C_SCRIPT_SRC := scripts/services/bucket_storage_c
PURGE_SCRIPT_SRC := scripts/tasks/purge
PURGE_C_SCRIPT_SRC := scripts/tasks/purge_system
CHECK_UPDATES_SCRIPT_SRC := scripts/tasks/check_updates
Expand Down Expand Up @@ -366,9 +363,6 @@ scripts_install : $(SCRIPTS_INSTALL_DIR) \
install_storage_service_script \
install_north_c_script \
install_north_service_c_script \
install_notification_c_script \
install_dispatcher_c_script \
install_bucket_storage_c_script \
install_purge_script \
install_check_updates_script \
install_statistics_script \
Expand Down Expand Up @@ -423,15 +417,6 @@ install_north_c_script : $(SCRIPT_TASKS_INSTALL_DIR) $(NORTH_C_SCRIPT_SRC)
install_north_service_c_script : $(SCRIPT_SERVICES_INSTALL_DIR) $(NORTH_SERVICE_C_SCRIPT_SRC)
$(CP) $(NORTH_SERVICE_C_SCRIPT_SRC) $(SCRIPT_SERVICES_INSTALL_DIR)

install_notification_c_script: $(SCRIPT_SERVICES_INSTALL_DIR) $(NOTIFICATION_C_SCRIPT_SRC)
$(CP) $(NOTIFICATION_C_SCRIPT_SRC) $(SCRIPT_SERVICES_INSTALL_DIR)

install_dispatcher_c_script: $(SCRIPT_SERVICES_INSTALL_DIR) $(DISPATCHER_C_SCRIPT_SRC)
$(CP) $(DISPATCHER_C_SCRIPT_SRC) $(SCRIPT_SERVICES_INSTALL_DIR)

install_bucket_storage_c_script: $(SCRIPT_SERVICES_INSTALL_DIR) $(BUCKET_STORAGE_C_SCRIPT_SRC)
$(CP) $(BUCKET_STORAGE_C_SCRIPT_SRC) $(SCRIPT_SERVICES_INSTALL_DIR)

install_purge_script : $(SCRIPT_TASKS_INSTALL_DIR) $(PURGE_SCRIPT_SRC)
$(CP) $(PURGE_SCRIPT_SRC) $(SCRIPT_TASKS_INSTALL_DIR)
$(CP) $(PURGE_C_SCRIPT_SRC) $(SCRIPT_TASKS_INSTALL_DIR)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
fledge_version=3.1.0
fledge_schema=76
fledge_schema=77
25 changes: 2 additions & 23 deletions python/fledge/common/service_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,7 @@


class ServiceRecord(object):
"""Used to information regarding a registered microservice.
"""

class Type(IntEnum):
"""Enumeration for Service Types"""

Storage = 1
Core = 2
Southbound = 3
Notification = 4
Management = 5
Northbound = 6
Dispatcher = 7
BucketStorage = 8
Pipeline = 9
"""Used to information regarding a registered microservice."""

class Status(IntEnum):
"""Enumeration for Service Status"""
Expand All @@ -40,9 +26,6 @@ class Status(IntEnum):
Unresponsive = 4
Restart = 5

class InvalidServiceType(Exception):
# TODO: tell allowed service types?
pass

class InvalidServiceStatus(Exception):
# TODO: tell allowed service status?
Expand All @@ -53,7 +36,7 @@ class InvalidServiceStatus(Exception):
def __init__(self, s_id, s_name, s_type, s_protocol, s_address, s_port, m_port):
self._id = s_id
self._name = s_name
self._type = self.valid_type(s_type) # check with ServiceRecord.Type, if not a valid type raise error
self._type = s_type
self._protocol = s_protocol
self._address = s_address
self._port = None
Expand All @@ -72,7 +55,3 @@ def __repr__(self):
def __str__(self):
return self.__repr__()

def valid_type(self, s_type):
if s_type not in ServiceRecord.Type.__members__:
raise ServiceRecord.InvalidServiceType
return s_type
15 changes: 10 additions & 5 deletions python/fledge/services/core/api/notification.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ def __init__(self, message="Failed to fetch notification plugins."):
async def fetch_plugins():
""" Fetch all rule and delivery plugins from notification service """
try:
notification_service = ServiceRegistry.get(s_type=ServiceRecord.Type.Notification.name)
# FIXME: Fetch type from Service Info
notification_service = ServiceRegistry.get(s_type="Notification")
_address, _port = notification_service[0]._address, notification_service[0]._port
except service_registry_exceptions.DoesNotExist:
raise ValueError("No Notification service available.")
Expand Down Expand Up @@ -197,7 +198,8 @@ async def post_notification(request):
curl -X POST http://localhost:8081/fledge/notification -d '{"name": "Test Notification", "description":"Test Notification", "rule": "threshold", "channel": "email", "notification_type": "one shot", "enabled": false, "rule_config": {}, "delivery_config": {}}'
"""
try:
notification_service = ServiceRegistry.get(s_type=ServiceRecord.Type.Notification.name)
# FIXME: Fetch type from Service Info
notification_service = ServiceRegistry.get(s_type="Notification")
_address, _port = notification_service[0]._address, notification_service[0]._port
except service_registry_exceptions.DoesNotExist:
raise web.HTTPNotFound(reason="No Notification service available.")
Expand Down Expand Up @@ -331,7 +333,8 @@ async def put_notification(request):
curl -X PUT http://localhost:8081/fledge/notification/<notification_name> -d '{"description":"Test Notification", "rule": "threshold", "channel": "email", "notification_type": "one shot", "enabled": false, "rule_config": {}, "delivery_config": {}}'
"""
try:
notification_service = ServiceRegistry.get(s_type=ServiceRecord.Type.Notification.name)
# FIXME: Fetch type from Service Info
notification_service = ServiceRegistry.get(s_type="Notification")
_address, _port = notification_service[0]._address, notification_service[0]._port
except service_registry_exceptions.DoesNotExist:
raise web.HTTPNotFound(reason="No Notification service available.")
Expand Down Expand Up @@ -467,7 +470,8 @@ async def delete_notification(request):
curl -X DELETE http://localhost:8081/fledge/notification/<notification_name>
"""
try:
notification_service = ServiceRegistry.get(s_type=ServiceRecord.Type.Notification.name)
# FIXME: Fetch type from Service Info
notification_service = ServiceRegistry.get(s_type="Notification")
_address, _port = notification_service[0]._address, notification_service[0]._port
except service_registry_exceptions.DoesNotExist:
raise web.HTTPNotFound(reason="No Notification service available.")
Expand Down Expand Up @@ -756,7 +760,8 @@ async def delete_delivery_channel(request: web.Request) -> web.Response:
"""

try:
notification_service = ServiceRegistry.get(s_type=ServiceRecord.Type.Notification.name)
# FIXME: Fetch type from Service Info
notification_service = ServiceRegistry.get(s_type="Notification")
_address, _port = notification_service[0]._address, notification_service[0]._port

except service_registry_exceptions.DoesNotExist:
Expand Down
Loading