File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ def __init__(
2525 start_time : datetime ,
2626 service_url : str ,
2727 registration_interval_sec : int ,
28+ application_metadata : dict
2829 ) -> None :
2930 self .registration_url = registration_url
3031 self .registration_auth = registration_auth
@@ -34,6 +35,7 @@ def __init__(
3435 self .service_url = service_url if service_url .endswith ("/" ) else service_url + "/"
3536 self .registration_interval_sec = registration_interval_sec
3637 self .instance_id = None
38+ self .application_metadata = application_metadata
3739
3840 self .should_continue_registration_schedule : bool = False
3941 self .disable_certificate_validation_for_https_registration : bool = \
@@ -58,7 +60,10 @@ def _register_with_admin_server(self) -> None:
5860 "managementUrl" : self .pyctuator_base_url ,
5961 "healthUrl" : f"{ self .pyctuator_base_url } /health" ,
6062 "serviceUrl" : self .service_url ,
61- "metadata" : {"startup" : self .start_time .isoformat ()}
63+ "metadata" : {
64+ "startup" : self .start_time .isoformat (),
65+ ** self .application_metadata
66+ }
6267 }
6368
6469 logging .debug ("Trying to post registration data to %s: %s" ,
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ def __init__(
3838 logfile_max_size : int = 10000 ,
3939 logfile_formatter : str = default_logfile_format ,
4040 auto_deregister : bool = True ,
41+ metadata : dict = None
4142 ) -> None :
4243 """The entry point for integrating pyctuator with a web-frameworks such as FastAPI and Flask.
4344
@@ -120,6 +121,7 @@ def __init__(
120121 start_time ,
121122 app_url ,
122123 registration_interval_sec ,
124+ metadata
123125 )
124126
125127 # Deregister from SBA on exit
You can’t perform that action at this time.
0 commit comments