harp_apps.proxy.settings.remote.endpoint

Inheritance diagram of harp_apps.proxy.settings.remote.endpoint

class RemoteEndpoint[source]

Bases: Stateful[RemoteEndpointSettings]

Stateful version of a remote endpoint definition.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

failure(reason=None)[source]

Returns a boolean indicating if a state change happened.

Parameters:

reason (str)

success()[source]

Returns a boolean indicating if a state change happened.

Return type:

bool

failure_reasons: set | None
liveness: IgnoreLiveness | InheritLiveness | LeakyBucketLiveness | NaiveLiveness
model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[Dict[str, FieldInfo]] = {'failure_reasons': FieldInfo(annotation=Union[set, NoneType], required=False, default=None), 'liveness': FieldInfo(annotation=Union[IgnoreLiveness, InheritLiveness, LeakyBucketLiveness, NaiveLiveness], required=False, default=None, exclude=True), 'settings': FieldInfo(annotation=RemoteEndpointSettings, required=True, repr=False), 'status': FieldInfo(annotation=int, required=False, default=0)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

settings: Annotated[TSettings, Field(repr=False)]
status: int
class RemoteEndpointSettings[source]

Bases: Configurable

A HttpEndpoint is an instrumented target URL that a proxy will use to route requests. It is used as the configuration parser for proxy.endpoints[].remote.endpoints[] settings.

url: "http://my-endpoint:8080"
pools: [fallback]  # omit for default pool
failure_threshold: 3
success_threshold: 1

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

classmethod serialize_in_order(value)[source]
Parameters:

value (List[str])

classmethod validate_pools(pools)[source]
Parameters:

pools (List[str])

Return type:

List[str]

liveness: Annotated[IgnoreLivenessSettings | InheritLivenessSettings | LeakyBucketLivenessSettings | NaiveLivenessSettings, Discriminator(discriminator=type, custom_error_type=None, custom_error_message=None, custom_error_context=None)]
model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[Dict[str, FieldInfo]] = {'liveness': FieldInfo(annotation=Union[IgnoreLivenessSettings, InheritLivenessSettings, LeakyBucketLivenessSettings, NaiveLivenessSettings], required=False, default_factory=InheritLivenessSettings, metadata=[Discriminator(discriminator='type', custom_error_type=None, custom_error_message=None, custom_error_context=None)]), 'pools': FieldInfo(annotation=List[str], required=False, default=['default']), 'url': FieldInfo(annotation=Url, required=True, metadata=[UrlConstraints(max_length=2083, allowed_schemes=['http', 'https'], host_required=None, default_host=None, default_port=None, default_path=None)])}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

pools: List[str]
url: Annotated[Url, UrlConstraints(max_length=2083, allowed_schemes=['http', 'https'], host_required=None, default_host=None, default_port=None, default_path=None)]