Skip to main content

unisos.mmwsIcm Library

MM-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 Packages

Sources Repositories

Packages Repositories

Support

For support, criticism, comments and questions; please contact the author/maintainer

Documentation

Part of ByStar Digital Ecosystem http://www.by-star.net.

On 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 Examples

  • bin/rinvoker.py
    A starting point template to be customized for your own swagger file.
  • bin/rinvokerPetstore.py
    Provides a list of Petstore example command line invokations.
  • bin/opScnPetstore.py
    Points to various scenario files for the Petstore example.

Remote Invoker (rinvoker-svc.py) Examples

For the example “Pet Store Service” at http://petstore.swagger.io/v2/swagger.json at command-line (or in bash) you can run:

rinvokerPetstore.py

Which 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=1

Which 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) Examples

For the example “Pet Store Service” at http://petstore.swagger.io/v2/swagger.json using python with RO_ abstractions you can specify remote invokation and expectations.

To get a list of some example scenatios run:

opScnPetstore.py

To 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 roListExpectations

Which 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'}]}
* ==:: SUCCESS

Python Example Usage

Invoker (Client) Development

from unisos.mmwsIcm import wsInvokerIcm
from unisos.mmwsIcm import ro

Testing Framework

from unisos.mmwsIcm import wsInvokerIcm
from unisos.mmwsIcm import ro

Performer (Server) Development

from unisos.mmwsIcm import wsInvokerIcm
from unisos.mmwsIcm import ro

Metadata

Release files for unisos.mmwsIcm 0.22

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for unisos.mmwsIcm 0.22
File Size Uploaded
unisos.mmwsIcm-0.22.tar.gz 48.5 kB Details

Release files / unisos.mmwsIcm-0.22.tar.gz

Download URL unisos.mmwsIcm-0.22.tar.gz
Size 48.5 kB
Tags Source
SHA-256 checksum
How to use checksums
07b675b2065966fb0207764cd2cbc9a7d1471a2699a361b176efb36c1a8f0496
BLAKE2b-256 checksum
How to use checksums
bf30dc52b23e9b32fd8ba3b49455beda0baf4d593a4be3122abde5a4ba880e03
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.2

Release history Release notifications | RSS feed

This release

0.22 This release

1 release file

0.21

1 release file

0.20

1 release file

0.19

1 release file

0.18

1 release file

0.17

1 release file

0.16

1 release file

0.15

1 release file

0.14

1 release file

0.12

1 release file

0.11

1 release file

0.10

1 release file

0.9

1 release file

0.8

1 release file

0.7

1 release file

0.6

1 release file

0.5

1 release file

0.4

1 release file

0.3

1 release file

0.2

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page