@@ -199,6 +199,7 @@ def from_data(cls, dat, key: list[str], *, container_name: str, ctx: Context) ->
199199class PackitAPI :
200200 container_name : str
201201 image : constellation .ImageReference
202+ # port at which api provides health metrics, separately proxied by montagu API - different from Proxy port_metrics!
202203 management_port : int
203204 base_url : str
204205 cors_allowed_origins : str
@@ -312,15 +313,24 @@ class Proxy:
312313 hostname : str
313314 port_http : int
314315 port_https : int
316+ # port at which proxy will provide api and outpack server metrics. Different from PackitAPI management_port!
317+ port_metrics : Optional [int ]
315318
316319 @classmethod
317320 def from_data (cls , dat , key : list [str ], * , ctx : Context ) -> "Proxy" :
318321 image = config_buildable (dat , [* key , "image" ], repo = ctx .repo , root = ctx .root )
319322 hostname = config .config_string (dat , [* key , "hostname" ])
320323 port_http = config .config_integer (dat , [* key , "port_http" ])
321324 port_https = config .config_integer (dat , [* key , "port_https" ])
325+ port_metrics = config .config_integer (dat , [* key , "port_metrics" ], is_optional = True )
322326
323- return Proxy (image = image , hostname = hostname , port_http = port_http , port_https = port_https )
327+ return Proxy (
328+ image = image ,
329+ hostname = hostname ,
330+ port_http = port_http ,
331+ port_https = port_https ,
332+ port_metrics = port_metrics ,
333+ )
324334
325335
326336@dataclass
@@ -397,12 +407,16 @@ def outpack_server_url(self) -> str:
397407 return f"http://{ self .outpack_server .container_name } :8000"
398408
399409 @property
400- def packit_app_endpoint (self ) -> str :
401- return f"{ self .packit_app .container_name } :80"
410+ def packit_app_url (self ) -> str :
411+ return f"http://{ self .packit_app .container_name } :80"
412+
413+ @property
414+ def packit_api_url (self ) -> str :
415+ return f"http://{ self .packit_api .container_name } :8080"
402416
403417 @property
404- def packit_api_endpoint (self ) -> str :
405- return f"{ self .packit_api .container_name } :8080 "
418+ def packit_api_management_url (self ) -> str :
419+ return f"http:// { self .packit_api .container_name } :{ self . packit_api . management_port } "
406420
407421
408422class PackitConfig :
0 commit comments