Rules Module

class arrowhead_client.rules.OrchestrationRule(consumed_service, provider_system, method='', authorization_token='', data_model=None)

Collection of objects necessary to perform service consumption.

Parameters
  • consumed_service (Service) – Service to be consumed.

  • provider_system (ArrowheadSystem) – System providing service.

  • method (str) – What method, if the protocol requires one, is used to consume the service.

  • authorization_token (str) – Authorization token provided by the Authorization System if consumed service uses the token access policy.

  • data_model (type[M] | None) –

property access_policy: str

Access policy used by consumed service, either TOKEN, CERTIFICATE, or UNRESTRICTED

Return type

str

property authentication_info: str

Provider system certificate string in DER format

Return type

str

property authorization_token: str

Authorization token

Return type

str

property endpoint: str

The URI to the service, without the protocol

Return type

str

property metadata: Optional[Mapping[str, str]]

Metadata registered in the Service Registry

Return type

Optional[Mapping[str, str]]

property method: str

Method used by service

Return type

str

property payload_type: str

Payload type, e.g. JSON or TEXT

Return type

str

property protocol: str

Protocol (e.g. HTTP or WS)

Return type

str

property secure: str

Security level, either SECURE (tls) or NOT_SECURE (no tls)

Return type

str

property service_definition: str

Service definition registered in the Service Registry

Return type

str

property system_name: str

Provider system name

Return type

str

property version: Optional[Union[int, str]]

Version of consumed service

Return type

Union[int, str, None]

class arrowhead_client.rules.OrchestrationRuleContainer

Orchestration Rule Container.

This class is a thin wrapper around a dictionary, except for the OrchestrationRuleContainer.store() method.

store(item)

Takes an OrchestrationRule and stores it with the key item.service_definition

Parameters

item (OrchestrationRule) – OrchestrationRule to be stored.

class arrowhead_client.rules.RegistrationRule(provided_service, provider_system, method, func, access_policy=None, data_model=None)

Collection of objects necessary to provide a service.

provided_service: Service provided by the provider_system. provider_system: System providing provided_service. method: Method, if applicable, necessary to consume provided_service. func: Function that performs the logic of the service. access_policy: Access policy used by service.

Parameters
  • provided_service (Service) –

  • provider_system (ArrowheadSystem) –

  • method (str) –

  • func (Callable[[Request], Any]) –

  • access_policy (AccessPolicy) –

  • data_model (Optional[type[BaseModel]]) –

class arrowhead_client.rules.RegistrationRuleContainer

Registration Rule Container