1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
|
%global _empty_manifest_terminate_build 0
Name: python-halo-bian
Version: 0.12.54
Release: 1
Summary: this is the Halo Bian library
License: MIT License
URL: https://github.com/halo-framework/halo-bian
Source0: https://mirrors.aliyun.com/pypi/web/packages/8f/2d/122d3ec42f344b069d04d45e7804b797fea084fed71cf0c2efbc85fdc600/halo-bian-0.12.54.tar.gz
BuildArch: noarch
%description
<p align="center">
<img src="https://i.ibb.co/9V7gLNH/halo-plat.png" alt="Halo Serverless" border="0" height="250" width="500" />
</p>
# Halo Bian - Flask BIAN Python Reference Architecture Library
The **Halo Bian** library is based on the [**Halo**](https://github.com/halo-framework/halo-app) library which is a python based library utilizing [**Serverless**](https://logz.io/blog/serverless-vs-containers/) technology and [**microservices architecture**](http://blog.binaris.com/your-guide-to-migrating-existing-microservices-to-serverless/)
BIAN (Banking Industry Architecture Network) is a membership group committed to developing open standards around banking and financial services. A key deliverable of this group is the BIAN Service Landscape model which defines a comprehensive services architecture for financial transactions and facilities. This library is an implementation of the BIAN model leveraging the Flask framework and allows a developer to **rapidly create BIAN-compliant services** while hiding much of the underlying BIAN model details. See www.bian.org for more information on BIAN.
This library leverages not only the Flask framework, but a number of the Flask Cloud Services components as well to facilitate building robust and resilient cloud-native BIAN microservices.
deploy your Service Domain to your local environment or use [**Serverless Framework**](https://serverless.com/) and [**zappa**](https://github.com/Miserlou/Zappa) to deploy your Service Domain to AWS.
## BIAN Basics
Before diving into the library architecture, it helps to understand two key concepts within BIAN, service domains and control records.
### Service Domain
The BIAN Service Landscape defines discrete areas of responsibility known as service domains. A **Service Domain** is a combination of a **Functional Pattern** and an **Asset Type**. For instance, using the functional pattern 'Registry' with the asset type 'Product' would yield a 'Product Registry' service domain, which could be used to manage a product catalog. If we instead changed the asset type to 'Device', we would have a 'Device Registry' service domain that could be used to authorize services on a mobile device.
### Control Record
The **Control Record** is used to track the state of a service domain, and like the service domain is derived from the functional pattern and asset type. However, in a control record, the functional pattern is represented by the **Generic Artifact Type**. There is a one-to-one correlation between functional patterns and generic artifact types. The control record goes one step further in delineating between specific service domain operations by introducing an additional parameter called the **Behavior Qualifier**, which, like generic artifact types, have a one-to-one correlation with functional patterns.
### In Addition
- The commercial behaviors that are called Functional Patterns. Functional Patterns, Generic Artifacts and Behavior Qualifier Types are mapped and correlated:
<p/>
[**Image From Bian Manual**](https://bian.org)
- A Service Domain applies one of the 18 functional patterns to instances of one type of asset:
<p/>
[**Image From Bian Manual**](https://bian.org)
- The standard set of ‘action terms’ that characterize the range of service operation calls :
<p/>
[**Image From Bian Manual**](https://bian.org)
- The Default Action Term By Functional Pattern matrix:
<p/>
[**Image From Bian Manual**](https://bian.org)
### BIAN Summary
So to summarize the above:
**Functional Pattern** ==> **Generic Artifact Type** ==> **Behavior Qualifier**
**Functional Pattern** + **Asset Type** = **Service Domain**
**Generic Artifact Type** + **Asset Type** + (optional)**Behavior Qualifier** = **Control Record**
**Functional Pattern** is correlated with a set of **Action Term** = **Service Domain Operations**
Key Benefits of using BIAN API solutions:
- Support for Emerging Industry Approaches – Two key technology approaches are considered: API development and the adoption of a Micro-service architecture
- Support for Industry Standards – The BIAN Service Domains and service operations present an Industry standard definition for the componentization and service enablement of Banking
- Support for Incremental Adoption/Migration – BIAN aligned solutions can be implemented and adopted incrementally enabling a prioritized migration from constraining legacy architectures
## Architecture
The Flask BIAN library implements a BIAN service domain wrapper that acts as an API and data translator while hiding much of the BIAN model complexity from the developer.

<p/>Halo Bian provides the following features:
- Bian version 7 - API release competability
- OAS ver. 2 support
- BianRequest object provides bian parameters support
- ServiceProperties object provides service status
- AssetType, GenericArtifact, BehaviorQualifier support per service domain
- BianServiceInfo object privides Bian details per service
- Support for all Bian Service Operations
- Support for all FunctionalPatterns
<p/>Halo provides the following features:
- Flask development for AWS Lambda & Dynamodb
- [correlation id across microservices](https://theburningmonk.com/2017/09/capture-and-forward-correlation-ids-through-different-lambda-event-sources/)
- [structured json based logging](https://theburningmonk.com/2018/01/you-need-to-use-structured-logging-with-aws-lambda/)
- [sample debug log in production](https://theburningmonk.com/2018/04/you-need-to-sample-debug-logs-in-production/)
- [support for microservice transactions with the saga pattern](https://read.acloud.guru/how-the-saga-pattern-manages-failures-with-aws-lambda-and-step-functions-bc8f7129f900)
- [using SSM Parameter Store over Lambda env variables](https://hackernoon.com/you-should-use-ssm-parameter-store-over-lambda-env-variables-5197fc6ea45b)
- [Serverless Error Handling & trace id for end users](https://aws.amazon.com/blogs/compute/error-handling-patterns-in-amazon-api-gateway-and-aws-lambda/)
- [Lambda timeout](https://blog.epsagon.com/best-practices-for-aws-lambda-timeouts) management for [slow HTTP responses](https://theburningmonk.com/2018/01/aws-lambda-use-the-invocation-context-to-better-handle-slow-http-responses/)
- [ootb support for Idempotent service invocations (md5)](https://cloudonaut.io/your-lambda-function-might-execute-twice-deal-with-it/)
If you are building a Python web app running on AWS Lambda (Flask), use this library to manage api transactions:
```
sagax = load_saga("test", jsonx, schema)
payloads = {"BookHotel": {"abc": "def"}, "BookFlight": {"abc": "def"}, "BookRental": {"abc": "def"},
"CancelHotel": {"abc": "def"}, "CancelFlight": {"abc": "def"}, "CancelRental": {"abc": "def"}}
apis = {"BookHotel": self.create_api1, "BookFlight": self.create_api2, "BookRental": self.create_api3,
"CancelHotel": self.create_api4, "CancelFlight": self.create_api5, "CancelRental": self.create_api6}
try:
self.context = Util.get_lambda_context(request)
ret = sagax.execute(self.req_context, payloads, apis)
return {"saga": "good"}, 200
except SagaRollBack as e:
return {"saga": "bad"}, 500
```
## License
This project is licensed under the MIT License
## Acknowledgments
* Pivotal-Field-Engineering - https://github.com/Pivotal-Field-Engineering/spring-bian
* Bian api - https://github.com/bianapis
* Bian - http://bian.org
%package -n python3-halo-bian
Summary: this is the Halo Bian library
Provides: python-halo-bian
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pip
%description -n python3-halo-bian
<p align="center">
<img src="https://i.ibb.co/9V7gLNH/halo-plat.png" alt="Halo Serverless" border="0" height="250" width="500" />
</p>
# Halo Bian - Flask BIAN Python Reference Architecture Library
The **Halo Bian** library is based on the [**Halo**](https://github.com/halo-framework/halo-app) library which is a python based library utilizing [**Serverless**](https://logz.io/blog/serverless-vs-containers/) technology and [**microservices architecture**](http://blog.binaris.com/your-guide-to-migrating-existing-microservices-to-serverless/)
BIAN (Banking Industry Architecture Network) is a membership group committed to developing open standards around banking and financial services. A key deliverable of this group is the BIAN Service Landscape model which defines a comprehensive services architecture for financial transactions and facilities. This library is an implementation of the BIAN model leveraging the Flask framework and allows a developer to **rapidly create BIAN-compliant services** while hiding much of the underlying BIAN model details. See www.bian.org for more information on BIAN.
This library leverages not only the Flask framework, but a number of the Flask Cloud Services components as well to facilitate building robust and resilient cloud-native BIAN microservices.
deploy your Service Domain to your local environment or use [**Serverless Framework**](https://serverless.com/) and [**zappa**](https://github.com/Miserlou/Zappa) to deploy your Service Domain to AWS.
## BIAN Basics
Before diving into the library architecture, it helps to understand two key concepts within BIAN, service domains and control records.
### Service Domain
The BIAN Service Landscape defines discrete areas of responsibility known as service domains. A **Service Domain** is a combination of a **Functional Pattern** and an **Asset Type**. For instance, using the functional pattern 'Registry' with the asset type 'Product' would yield a 'Product Registry' service domain, which could be used to manage a product catalog. If we instead changed the asset type to 'Device', we would have a 'Device Registry' service domain that could be used to authorize services on a mobile device.
### Control Record
The **Control Record** is used to track the state of a service domain, and like the service domain is derived from the functional pattern and asset type. However, in a control record, the functional pattern is represented by the **Generic Artifact Type**. There is a one-to-one correlation between functional patterns and generic artifact types. The control record goes one step further in delineating between specific service domain operations by introducing an additional parameter called the **Behavior Qualifier**, which, like generic artifact types, have a one-to-one correlation with functional patterns.
### In Addition
- The commercial behaviors that are called Functional Patterns. Functional Patterns, Generic Artifacts and Behavior Qualifier Types are mapped and correlated:
<p/>
[**Image From Bian Manual**](https://bian.org)
- A Service Domain applies one of the 18 functional patterns to instances of one type of asset:
<p/>
[**Image From Bian Manual**](https://bian.org)
- The standard set of ‘action terms’ that characterize the range of service operation calls :
<p/>
[**Image From Bian Manual**](https://bian.org)
- The Default Action Term By Functional Pattern matrix:
<p/>
[**Image From Bian Manual**](https://bian.org)
### BIAN Summary
So to summarize the above:
**Functional Pattern** ==> **Generic Artifact Type** ==> **Behavior Qualifier**
**Functional Pattern** + **Asset Type** = **Service Domain**
**Generic Artifact Type** + **Asset Type** + (optional)**Behavior Qualifier** = **Control Record**
**Functional Pattern** is correlated with a set of **Action Term** = **Service Domain Operations**
Key Benefits of using BIAN API solutions:
- Support for Emerging Industry Approaches – Two key technology approaches are considered: API development and the adoption of a Micro-service architecture
- Support for Industry Standards – The BIAN Service Domains and service operations present an Industry standard definition for the componentization and service enablement of Banking
- Support for Incremental Adoption/Migration – BIAN aligned solutions can be implemented and adopted incrementally enabling a prioritized migration from constraining legacy architectures
## Architecture
The Flask BIAN library implements a BIAN service domain wrapper that acts as an API and data translator while hiding much of the BIAN model complexity from the developer.

<p/>Halo Bian provides the following features:
- Bian version 7 - API release competability
- OAS ver. 2 support
- BianRequest object provides bian parameters support
- ServiceProperties object provides service status
- AssetType, GenericArtifact, BehaviorQualifier support per service domain
- BianServiceInfo object privides Bian details per service
- Support for all Bian Service Operations
- Support for all FunctionalPatterns
<p/>Halo provides the following features:
- Flask development for AWS Lambda & Dynamodb
- [correlation id across microservices](https://theburningmonk.com/2017/09/capture-and-forward-correlation-ids-through-different-lambda-event-sources/)
- [structured json based logging](https://theburningmonk.com/2018/01/you-need-to-use-structured-logging-with-aws-lambda/)
- [sample debug log in production](https://theburningmonk.com/2018/04/you-need-to-sample-debug-logs-in-production/)
- [support for microservice transactions with the saga pattern](https://read.acloud.guru/how-the-saga-pattern-manages-failures-with-aws-lambda-and-step-functions-bc8f7129f900)
- [using SSM Parameter Store over Lambda env variables](https://hackernoon.com/you-should-use-ssm-parameter-store-over-lambda-env-variables-5197fc6ea45b)
- [Serverless Error Handling & trace id for end users](https://aws.amazon.com/blogs/compute/error-handling-patterns-in-amazon-api-gateway-and-aws-lambda/)
- [Lambda timeout](https://blog.epsagon.com/best-practices-for-aws-lambda-timeouts) management for [slow HTTP responses](https://theburningmonk.com/2018/01/aws-lambda-use-the-invocation-context-to-better-handle-slow-http-responses/)
- [ootb support for Idempotent service invocations (md5)](https://cloudonaut.io/your-lambda-function-might-execute-twice-deal-with-it/)
If you are building a Python web app running on AWS Lambda (Flask), use this library to manage api transactions:
```
sagax = load_saga("test", jsonx, schema)
payloads = {"BookHotel": {"abc": "def"}, "BookFlight": {"abc": "def"}, "BookRental": {"abc": "def"},
"CancelHotel": {"abc": "def"}, "CancelFlight": {"abc": "def"}, "CancelRental": {"abc": "def"}}
apis = {"BookHotel": self.create_api1, "BookFlight": self.create_api2, "BookRental": self.create_api3,
"CancelHotel": self.create_api4, "CancelFlight": self.create_api5, "CancelRental": self.create_api6}
try:
self.context = Util.get_lambda_context(request)
ret = sagax.execute(self.req_context, payloads, apis)
return {"saga": "good"}, 200
except SagaRollBack as e:
return {"saga": "bad"}, 500
```
## License
This project is licensed under the MIT License
## Acknowledgments
* Pivotal-Field-Engineering - https://github.com/Pivotal-Field-Engineering/spring-bian
* Bian api - https://github.com/bianapis
* Bian - http://bian.org
%package help
Summary: Development documents and examples for halo-bian
Provides: python3-halo-bian-doc
%description help
<p align="center">
<img src="https://i.ibb.co/9V7gLNH/halo-plat.png" alt="Halo Serverless" border="0" height="250" width="500" />
</p>
# Halo Bian - Flask BIAN Python Reference Architecture Library
The **Halo Bian** library is based on the [**Halo**](https://github.com/halo-framework/halo-app) library which is a python based library utilizing [**Serverless**](https://logz.io/blog/serverless-vs-containers/) technology and [**microservices architecture**](http://blog.binaris.com/your-guide-to-migrating-existing-microservices-to-serverless/)
BIAN (Banking Industry Architecture Network) is a membership group committed to developing open standards around banking and financial services. A key deliverable of this group is the BIAN Service Landscape model which defines a comprehensive services architecture for financial transactions and facilities. This library is an implementation of the BIAN model leveraging the Flask framework and allows a developer to **rapidly create BIAN-compliant services** while hiding much of the underlying BIAN model details. See www.bian.org for more information on BIAN.
This library leverages not only the Flask framework, but a number of the Flask Cloud Services components as well to facilitate building robust and resilient cloud-native BIAN microservices.
deploy your Service Domain to your local environment or use [**Serverless Framework**](https://serverless.com/) and [**zappa**](https://github.com/Miserlou/Zappa) to deploy your Service Domain to AWS.
## BIAN Basics
Before diving into the library architecture, it helps to understand two key concepts within BIAN, service domains and control records.
### Service Domain
The BIAN Service Landscape defines discrete areas of responsibility known as service domains. A **Service Domain** is a combination of a **Functional Pattern** and an **Asset Type**. For instance, using the functional pattern 'Registry' with the asset type 'Product' would yield a 'Product Registry' service domain, which could be used to manage a product catalog. If we instead changed the asset type to 'Device', we would have a 'Device Registry' service domain that could be used to authorize services on a mobile device.
### Control Record
The **Control Record** is used to track the state of a service domain, and like the service domain is derived from the functional pattern and asset type. However, in a control record, the functional pattern is represented by the **Generic Artifact Type**. There is a one-to-one correlation between functional patterns and generic artifact types. The control record goes one step further in delineating between specific service domain operations by introducing an additional parameter called the **Behavior Qualifier**, which, like generic artifact types, have a one-to-one correlation with functional patterns.
### In Addition
- The commercial behaviors that are called Functional Patterns. Functional Patterns, Generic Artifacts and Behavior Qualifier Types are mapped and correlated:
<p/>
[**Image From Bian Manual**](https://bian.org)
- A Service Domain applies one of the 18 functional patterns to instances of one type of asset:
<p/>
[**Image From Bian Manual**](https://bian.org)
- The standard set of ‘action terms’ that characterize the range of service operation calls :
<p/>
[**Image From Bian Manual**](https://bian.org)
- The Default Action Term By Functional Pattern matrix:
<p/>
[**Image From Bian Manual**](https://bian.org)
### BIAN Summary
So to summarize the above:
**Functional Pattern** ==> **Generic Artifact Type** ==> **Behavior Qualifier**
**Functional Pattern** + **Asset Type** = **Service Domain**
**Generic Artifact Type** + **Asset Type** + (optional)**Behavior Qualifier** = **Control Record**
**Functional Pattern** is correlated with a set of **Action Term** = **Service Domain Operations**
Key Benefits of using BIAN API solutions:
- Support for Emerging Industry Approaches – Two key technology approaches are considered: API development and the adoption of a Micro-service architecture
- Support for Industry Standards – The BIAN Service Domains and service operations present an Industry standard definition for the componentization and service enablement of Banking
- Support for Incremental Adoption/Migration – BIAN aligned solutions can be implemented and adopted incrementally enabling a prioritized migration from constraining legacy architectures
## Architecture
The Flask BIAN library implements a BIAN service domain wrapper that acts as an API and data translator while hiding much of the BIAN model complexity from the developer.

<p/>Halo Bian provides the following features:
- Bian version 7 - API release competability
- OAS ver. 2 support
- BianRequest object provides bian parameters support
- ServiceProperties object provides service status
- AssetType, GenericArtifact, BehaviorQualifier support per service domain
- BianServiceInfo object privides Bian details per service
- Support for all Bian Service Operations
- Support for all FunctionalPatterns
<p/>Halo provides the following features:
- Flask development for AWS Lambda & Dynamodb
- [correlation id across microservices](https://theburningmonk.com/2017/09/capture-and-forward-correlation-ids-through-different-lambda-event-sources/)
- [structured json based logging](https://theburningmonk.com/2018/01/you-need-to-use-structured-logging-with-aws-lambda/)
- [sample debug log in production](https://theburningmonk.com/2018/04/you-need-to-sample-debug-logs-in-production/)
- [support for microservice transactions with the saga pattern](https://read.acloud.guru/how-the-saga-pattern-manages-failures-with-aws-lambda-and-step-functions-bc8f7129f900)
- [using SSM Parameter Store over Lambda env variables](https://hackernoon.com/you-should-use-ssm-parameter-store-over-lambda-env-variables-5197fc6ea45b)
- [Serverless Error Handling & trace id for end users](https://aws.amazon.com/blogs/compute/error-handling-patterns-in-amazon-api-gateway-and-aws-lambda/)
- [Lambda timeout](https://blog.epsagon.com/best-practices-for-aws-lambda-timeouts) management for [slow HTTP responses](https://theburningmonk.com/2018/01/aws-lambda-use-the-invocation-context-to-better-handle-slow-http-responses/)
- [ootb support for Idempotent service invocations (md5)](https://cloudonaut.io/your-lambda-function-might-execute-twice-deal-with-it/)
If you are building a Python web app running on AWS Lambda (Flask), use this library to manage api transactions:
```
sagax = load_saga("test", jsonx, schema)
payloads = {"BookHotel": {"abc": "def"}, "BookFlight": {"abc": "def"}, "BookRental": {"abc": "def"},
"CancelHotel": {"abc": "def"}, "CancelFlight": {"abc": "def"}, "CancelRental": {"abc": "def"}}
apis = {"BookHotel": self.create_api1, "BookFlight": self.create_api2, "BookRental": self.create_api3,
"CancelHotel": self.create_api4, "CancelFlight": self.create_api5, "CancelRental": self.create_api6}
try:
self.context = Util.get_lambda_context(request)
ret = sagax.execute(self.req_context, payloads, apis)
return {"saga": "good"}, 200
except SagaRollBack as e:
return {"saga": "bad"}, 500
```
## License
This project is licensed under the MIT License
## Acknowledgments
* Pivotal-Field-Engineering - https://github.com/Pivotal-Field-Engineering/spring-bian
* Bian api - https://github.com/bianapis
* Bian - http://bian.org
%prep
%autosetup -n halo-bian-0.12.54
%build
%py3_build
%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
find usr/lib -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
find usr/lib64 -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
find usr/bin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
find usr/sbin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
find usr/share/man -type f -printf "\"/%h/%f.gz\"\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .
%files -n python3-halo-bian -f filelist.lst
%dir %{python3_sitelib}/*
%files help -f doclist.lst
%{_docdir}/*
%changelog
* Tue Jun 20 2023 Python_Bot <Python_Bot@openeuler.org> - 0.12.54-1
- Package Spec generated
|