@@ -13,11 +13,7 @@ Currently, it is working, but it's still missing many crucial features, such as:
1313 - Testing
1414 - Support for the following core services
1515 - Eventhandler
16- - Gateway
17- - Gatekeeper
18- - Support for the following security modes (access policies):
19- - Token security
20- - Insecure security
16+ - Support for the TOKEN security modes (access policy):
2117
2218As more Arrowhead Core Systems mature and are added to the official docker container, those will be added to this list.
2319
@@ -34,65 +30,3 @@ A guide on how to create your own certificates can be found on the [Arrowhead gi
3430## How To Use
3531Install the library with ` pip install arrowhead-client ` .
3632
37- ### Providing Services
38- To provide services, import the ` ProviderSystem ` .
39- Services can be added to the provider with the ` provided_services ` decorator.
40- The ` provided_services ` decorator will create a service, and register the service with the provider.
41- Then when the provider is started, using the ` run_forever ` method, the provider will automatically register the service with the service registry.
42-
43- #### Code Example
44- ``` python
45- import datetime
46- from arrowhead_client.system.provider import ProviderSystem
47-
48- # Create provider
49- time_provider = TimeProvider(
50- ' time_provider' ,
51- ' localhost' ,
52- 1337 ,
53- ' ' ,
54- keyfile = ' certificates/time_provider.key'
55- certfile = ' certificates/time_provider.crt' )
56-
57- # Add service
58- @time_provider.provided_service (' echo' , ' /time/echo' , ' HTTP-SECURE-JSON' , ' GET' )
59- def echo ():
60- return {' now' : str (datetime.datetime.now())}
61-
62- if __name__ == ' __main__' :
63- time_provider.run_forever()
64-
65- ```
66-
67- ### Consuming Services
68- To consume services, use the ` ConsumerSystem ` .
69- To find a consumed service, you first register a service definition using the ` add_consumed_services ` method.
70- When the ` ConsumerSystem ` is started initialized, it queries the orchestrator and will register the first orchestrated service.
71- That service is then consumed using the ` consume_service ` method.
72-
73- The orchestration query _ will fail_ if the orchestrator does not return a service, and crash as a consequence.
74- The plan is to make this robust later.
75-
76- #### Code Examples
77- ``` python
78-
79- from arrowhead_client.system.consumer import ConsumerSystem
80-
81- time_consumer = ConsumerSystem(
82- ' consumer_test' ,
83- ' localhost' ,
84- ' 1338' ,
85- ' ' ,
86- ' certificates/consumer_test.key' ,
87- ' certificates/consumer_test.crt' )
88-
89- # Add orchestration rules
90- time_consumer.add_orchestration_rule(' echo' , ' GET' )
91-
92- if __name__ == ' __main__' :
93- # Consume service provided by the 'get_time' rule
94- echo = time_consumer.consume_service(' echo' )
95- print (echo[' echo' ])
96-
97- ```
98-
0 commit comments