LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
line::ports Namespace Reference

Functions

int allocate (int offset)
 Host port for a given offset within the LINE block.
std::string default_url (int port)
 Base URL a service published on port of localhost is reachable at.
std::string lqns_default_url ()
 Default LqnsOptions::remote_url.
bool is_healthy (const std::string &base)
 True when <base>/api/v1/health answers 2xx.
bool is_lqns_service (const std::string &base)
 True when /api/v1/info lists a tool named lqns.
std::string resolve_lqns_url (const std::string &configured)
 URL the SolverLQNS remote path posts to, given LqnsOptions::remote_url.

Variables

constexpr int BLOCK_FIRST = 29200
 First host port of the reserved block.
constexpr int BLOCK_LAST = 29229
 Last host port of the reserved block.
constexpr int CONTAINER_PORT = 8080
 Port every service image listens on inside its container.
constexpr int LEGACY_PORT = 8080
 Host port every service used before the allocation; a verified fallback only.
constexpr int JMT_PORT = BLOCK_FIRST + 1
 imperialqore/jmt-rest.
constexpr int LQNS_PORT = BLOCK_FIRST + 2
 imperialqore/line-lqns-rest (lqns, lqsim and qnsolver share the image).
constexpr int LDES_PORT = BLOCK_FIRST + 3
 imperialqore/ldes-rest.
constexpr int SAGE_PORT = BLOCK_FIRST + 4
 imperialqore/line-sage-rest.

Function Documentation

◆ allocate()

int line::ports::allocate ( int offset)
inline

Host port for a given offset within the LINE block.

Definition at line 48 of file line_ports.h.

References allocate(), BLOCK_FIRST, and BLOCK_LAST.

Referenced by allocate().

◆ default_url()

std::string line::ports::default_url ( int port)
inline

Base URL a service published on port of localhost is reachable at.

Definition at line 67 of file line_ports.h.

References default_url().

Referenced by default_url(), lqns_default_url(), and resolve_lqns_url().

◆ is_healthy()

bool line::ports::is_healthy ( const std::string & base)
inline

True when <base>/api/v1/health answers 2xx.

Definition at line 82 of file line_ports.h.

References line::http::get(), is_healthy(), and line::http::Response::status.

Referenced by is_healthy(), and resolve_lqns_url().

◆ is_lqns_service()

bool line::ports::is_lqns_service ( const std::string & base)
inline

True when /api/v1/info lists a tool named lqns.

Identity is read, not assumed from the port: a line-sage-rest started by hand on 8080 answers /health just as an lqns-rest does.

Definition at line 97 of file line_ports.h.

References line::http::Response::body, line::http::get(), is_lqns_service(), and line::http::Response::status.

Referenced by is_lqns_service(), and resolve_lqns_url().

◆ lqns_default_url()

std::string line::ports::lqns_default_url ( )
inline

Default LqnsOptions::remote_url.

Definition at line 70 of file line_ports.h.

References default_url(), lqns_default_url(), and LQNS_PORT.

Referenced by lqns_default_url(), and resolve_lqns_url().

◆ resolve_lqns_url()

std::string line::ports::resolve_lqns_url ( const std::string & configured)
inline

URL the SolverLQNS remote path posts to, given LqnsOptions::remote_url.

A URL other than the default is used exactly as given. The default is used when it answers; otherwise an lqns-rest still published on the legacy port 8080, verified through /api/v1/info, is used with a warning telling the user to republish it. When neither answers the default is returned, so the request fails naming the URL the service is expected at.

Definition at line 123 of file line_ports.h.

References CONTAINER_PORT, default_url(), is_healthy(), is_lqns_service(), LEGACY_PORT, lqns_default_url(), LQNS_PORT, and resolve_lqns_url().

Referenced by resolve_lqns_url().

Variable Documentation

◆ BLOCK_FIRST

int line::ports::BLOCK_FIRST = 29200
constexpr

First host port of the reserved block.

Definition at line 39 of file line_ports.h.

Referenced by allocate().

◆ BLOCK_LAST

int line::ports::BLOCK_LAST = 29229
constexpr

Last host port of the reserved block.

Definition at line 41 of file line_ports.h.

Referenced by allocate().

◆ CONTAINER_PORT

int line::ports::CONTAINER_PORT = 8080
constexpr

Port every service image listens on inside its container.

Definition at line 43 of file line_ports.h.

Referenced by resolve_lqns_url().

◆ JMT_PORT

int line::ports::JMT_PORT = BLOCK_FIRST + 1
constexpr

imperialqore/jmt-rest.

Definition at line 58 of file line_ports.h.

◆ LDES_PORT

int line::ports::LDES_PORT = BLOCK_FIRST + 3
constexpr

imperialqore/ldes-rest.

Definition at line 62 of file line_ports.h.

◆ LEGACY_PORT

int line::ports::LEGACY_PORT = 8080
constexpr

Host port every service used before the allocation; a verified fallback only.

Definition at line 45 of file line_ports.h.

Referenced by resolve_lqns_url(), and line::sym::sym_probe_ports().

◆ LQNS_PORT

int line::ports::LQNS_PORT = BLOCK_FIRST + 2
constexpr

imperialqore/line-lqns-rest (lqns, lqsim and qnsolver share the image).

Definition at line 60 of file line_ports.h.

Referenced by lqns_default_url(), and resolve_lqns_url().

◆ SAGE_PORT

int line::ports::SAGE_PORT = BLOCK_FIRST + 4
constexpr

imperialqore/line-sage-rest.

Definition at line 64 of file line_ports.h.

Referenced by line::sym::sym_probe_ports().