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
, orUNRESTRICTED
- Return type
str
- property metadata: Optional[Mapping[str, str]]
-
Metadata registered in the Service Registry
- Return type
Optional
[Mapping
[str
,str
]]
- property service_definition: str
-
Service definition registered in the Service Registry
- Return type
str
- 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 providingprovided_service
. method: Method, if applicable, necessary to consumeprovided_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]]) –