Package: unisos.mmwsIcm
ContentsSources And PackagesSources RepositoriesPackages RepositoriesSupportDocumentationBinaries And Command-Line ExamplesRemote Invoker (rinvoker-svc.py) ExamplesOperation Scenario (opScn-svc.py) ExamplesPython Example UsageInvoker (Client) DevelopmentTesting FrameworkPerformer (Server) DevelopmentMM-WS-ICM Library: Machine-to-Machine Web Service Interactive Command
Modules (ICM) – A set of facilities for developing Performer and Invoker
web-services based on Swagger (Open-API) specifications through ICMs.Sources And PackagesSources RepositoriesGitHub:https://github.com/bisos-pip/mmwsIcmPackages RepositoriesPyPi:https://pypi.org/project/unisos.mmwsIcmSupportFor support, criticism, comments and questions; please contact the
author/maintainerMohsen Bananat:http://mohsen.1.banan.byname.net/contactDocumentationPart of ByStar Digital Ecosystemhttp://www.by-star.net.Remote Operations Interactive Command Modules (RO-ICM) – Best
Current (2019) Practices For Web Services Developmenthttp://www.by-star.net/PLPC/180056A Generalized Swagger (Open-API) Centered Web Services Testing
Frameworkhttp://www.by-star.net/PLPC/180057Interactive Command Modules (ICM) and Playershttp://www.by-star.net/PLPC/180050On the invoker side, a Swagger (Open-API) specification is digested with
bravado and is mapped to command line with ICM.On the performer side, a Swagger (Open-API) specification is used with
the code-generator to create a consistent starting point.An ICM can be auto-converted to become a web service.Binaries And Command-Line Examplesbin/rinvoker.pyA starting point template to be customized for your own swagger
file.bin/rinvokerPetstore.pyProvides a list of Petstore example command line invokations.bin/opScnPetstore.pyPoints to various scenario files for the Petstore example.Remote Invoker (rinvoker-svc.py) ExamplesFor the example “Pet Store Service” athttp://petstore.swagger.io/v2/swagger.jsonat command-line (or in bash)
you can run:rinvokerPetstore.pyWhich will auto generate a complete list of all supported remote
opperations in the Swagger Service Specification.You can then invoke any of those remote operations from the
command-line, by executing for example:rinvokerPetstore.py --svcSpec="http://petstore.swagger.io/v2/swagger.json" --resource="pet" --opName="getPetById"  -i rinvoke petId=1Which will produce something like:Operation Status: 200 OK
Operation Result: {   u'category': {   u'id': 0, u'name': u'string'},
    u'id': 1,
    u'name': u'testsw',
    u'photoUrls': [u'string'],
    u'status': u'tttest',
    u'tags': [{   u'id': 0, u'name': u'string'}]}By turning on verbosity to level 15 (rinvokerPetstore.py -v 15) you can
observe complete http traffic as reported by requests library.Operation Scenario (opScn-svc.py) ExamplesFor the example “Pet Store Service” athttp://petstore.swagger.io/v2/swagger.jsonusing python with RO_
abstractions you can specify remote invokation and expectations.To get a list of some example scenatios run:opScnPetstore.pyTo run a particular example scenario, you can then run:opScnPetstore.py  --load /tmp/py2v1/local/lib/python2.7/site-packages/unisos/mmwsIcm-base/opScn-1.py -i roListExpectationsWhich will produce something like:* ->:: @None@pet@getPetById
** ->:: svcSpec=http://petstore.swagger.io/v2/swagger.json
** ->:: Header Params: None
** ->:: Url Params:
{   'petId': 1}
** ->:: Body Params: None
* <-:: httpStatus=200 -- httpText=OK -- resultsFormat=json
** <-:: Operation Result:
{   u'category': {   u'id': 1, u'name': u'dog'},
    u'id': 1,
    u'name': u'Dog1',
    u'photoUrls': [],
    u'status': u'pending',
    u'tags': []}
* ==:: SUCCESS
* XX:: Sleeping For 1 Second
* ->:: @None@pet@getPetById
** ->:: svcSpec=http://petstore.swagger.io/v2/swagger.json
** ->:: Header Params: None
** ->:: Url Params:
{   'petId': 9999}
** ->:: Body Params: None
* <-:: httpStatus=200 -- httpText=OK -- resultsFormat=json
** <-:: Operation Result:
{   u'category': {   u'id': 99, u'name': u'SAGScope'},
    u'id': 9999,
    u'name': u'doggie',
    u'photoUrls': [u'string'],
    u'status': u'available',
    u'tags': [{   u'id': 99, u'name': u'SAGTags'}]}
* ==:: SUCCESSPython Example UsageInvoker (Client) Developmentfrom unisos.mmwsIcm import wsInvokerIcm
from unisos.mmwsIcm import roTesting Frameworkfrom unisos.mmwsIcm import wsInvokerIcm
from unisos.mmwsIcm import roPerformer (Server) Developmentfrom unisos.mmwsIcm import wsInvokerIcm
from unisos.mmwsIcm import ro