Skip to main content

bisos.mmWsCs: MM-WS-CS Library: Machine-to-Machine -- Web Services -- Command Services (CS) -- A

Project description

set of facilities for developing Performer and Invoker web-services based on Swagger (Open-API) specifications through ICMs.

Overview

bisos.mmWsCs is a python package for BISOS Capabilities Bundles – Abstraction, Specification and Materialization.

Package Documentation At Github

The information below is a subset of the full of documentation for this bisos-pip package. More complete documentation is available at: https://github.com/bisos-pip/mmWsCs-cs

Realted Resources

bisos Capabilities Panel

file:/panels/capab ilities/_nodeBase_/fullUsagePanel-en.org

Table of Contents TOC

Installation

The sources for the bisos.mmWsCs pip package is maintained at: https://github.com/bisos-pip/mmWsCs.

The bisos.mmWsCs pip package is available at PYPI as https://pypi.org/project/bisos.mmWsCs

You can install bisos.mmWsCs with pip or pipx.

Installation With pip

If you need access to bisos.mmWsCs as a python module, you can install it with pip:

pip install bisos.mmWsCs

Installation With pipx

If you only need access to bisos.mmWsCs as a command on command-line, you can install it with pipx:

pipx install bisos.mmWsCs

The following commands are made available:

  • 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

Part of BISOS and ByStar — ByStar Internet Services Operating System

Layered on top of Debian, BISOS: (By* Internet Services Operating System) is a unified and universal framework for developing both internet services and software-service continuums that use internet services. See Bootstrapping ByStar, BISOS and Blee for information about getting started with BISOS.
BISOS is a foundation for The Libre-Halaal ByStar Digital Ecosystem which is described as a cure for losses of autonomy and privacy in a book titled: Nature of Polyexistentials

bisos.mmWsCs is part of BISOS.

bisos.mmWsCs as a Standalone Piece of BISOS

bisos.mmWsCs is a standalone piece of BISOS. It can be used as a self-contained Python package separate from BISOS. Follow the installation and usage instructions below for your own use.

Documentation and Blee-Panels

bisos.mmWsCs is part of ByStar Digital Ecosystem http://www.by-star.net.

This module’s primary documentation is in the form of Blee-Panels. Additional information is also available in: http://www.by-star.net/PLPC/180047

bisos.mmWsCs Blee-Panels

bisos.mmWsCs Blee-Panels are in ./panels directory. From within Blee and BISOS these panels are accessible under the Blee “Panels” menu.

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.

Support

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bisos_mmwsicm-0.11.tar.gz (52.0 kB view details)

Uploaded Source

File details

Details for the file bisos_mmwsicm-0.11.tar.gz.

File metadata

  • Download URL: bisos_mmwsicm-0.11.tar.gz
  • Upload date:
  • Size: 52.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.2

File hashes

Hashes for bisos_mmwsicm-0.11.tar.gz
Algorithm Hash digest
SHA256 4d9249f0f3ac9d6006ed0c61b96975143315c543d48d14b031dddb76fe216e97
MD5 245e330c4b627c27d37a41982bddb57f
BLAKE2b-256 3630b557204566eda5009b2d88ae71fd56779cdaf8610f01c0f090fae79211e9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page