Copyright ©2014 Neda Communications, Inc.
Permission is granted to make and distribute complete (not partial)
verbatim copies of this document provided that the copyright notice
and this permission notice are preserved on all copies.
Part I |
Invoker ICMs Development Model
Given a Service Definition (a swagger file) and a Performer Server, you should be able to conveniently Invoke any of the offered Operations through:
Remote Invoker ICMs Development Model
Main software packages that implement the framework include:
Try It: pip install unisos.mmwsIcm
Part II |
rinvoker.py Overview
Allows you to list all possible invocations based on a service specification (swagger file).
rinvoker.py --svcSpec="http://petstore.swagger.io/v2/swagger.json" -i svcOpsList
Allows you to fully specify an invocation on command line. Example:
rinvoker.py --svcSpec="http://petstore.swagger.io/v2/swagger.json" --resource="user" --opName="createUser" -i rinvoke bodyStr="{...}"
Part III |
Model Of Invoke – Specification, Verification And Reporting – Scenarios
Scenario Specification For Sequences Of Invocations
In pure python specify invocation of each operation, for example:
rosList.opAdd( svcSpec=akSkToken_svcSpec, # e.g. "../SvcSpec/akSkToken.json" perfSap=akSkToken_perfSap, # e.g. "http://localhost:8080/access/v1.0" resource="token", opName="obtain", roParams=ro.Ro_Params( headerParams=None, urlParams=None, bodyParams={ 'accessKey': "someOtherId", 'secretKey': "someOtherCredentials",},), roResults=None, )
Then load that list of invocations and subject them to sequential invocations.
Validation And Reporting Of Invokations
Building on the previously mentioned Operation Specification, in pure python you can the specify Operation Expectations, for example:
roExpectationsList.opExpectationAdd( # Above mentioned operation specification # ... preInvokeCallables=[], postInvokeCallables=[ verify_akSkTokenObtainRo, ], )
For example, preInvokeCallables(ro.Ro_OpExpectation) can include a function that initializes the DB.
For example, postInvokeCallables(ro.Ro_OpExpectation) can include a function that verifies the operation’s result was as expected and then reports success or failure.
Invoker-Apps Can Easily Build On unisos.mmwsIcm Capabilities
With these in place, building Invoke-Apps becomes very simple.
Benefits And Advantages Of The Generalized Swagger Centered Invocation Model
Very Often, These Best Current Practices Are Not Being Followed.