bps-restpy


Namebps-restpy JSON
Version 10.70.33 PyPI version JSON
download
home_pageNone
SummaryBreakingPoint REST API Python Wrapper
upload_time2024-12-21 01:17:21
maintainerNone
docs_urlNone
authorNone
requires_python>=3.7
licenseMIT License Copyright (c) 2018 OpenIxia Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords bps rest api bps-rest-api-wrapper
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## The BreakingPoint RESTv2 API Python Wrapper
[![pypi](https://img.shields.io/pypi/v/bps-restpy.svg)](https://pypi.org/project/bps-restpy)
[![python](https://img.shields.io/pypi/pyversions/bps-restpy.svg)](https://pypi.python.org/pypi/bps-restpy)
[![license](https://img.shields.io/badge/license-MIT-green.svg)](https://en.wikipedia.org/wiki/MIT_License)
[![downloads](https://pepy.tech/badge/bps-restpy)](https://pepy.tech/project/bps-restpy)

## BreakingPoint detail
Network testing with  [BreakingPoint®](https://www.ixiacom.com/products/network-security-testing-breakingpoint). By simulating real-world legitimate traffic, distributed denial of service (DDoS), exploits, malware, and fuzzing, BreakingPoint validates an organization’s security infrastructure, reduces the risk of network degradation by almost 80%, and increases attack readiness by nearly 70%. And with our new TrafficREWIND solution, you'll get even more realistic and high-fidelity validation by adding production network insight into BreakingPoint test traffic configuration
More details:

## Install the package
```
pip install --upgrade bps-restpy
```

## Start scripting
```python
"""This script demonstrates how to get started with bps_restpy scripting.

# Title:  Python Script Sample To Run a Canned Test.
# Actions:
#   1. Login to BPS box
#   2. Reserve ports
#   3. Load a test from the box and start the run
#   4. Wait for the test to finish
#   5. Get test result
#   6. Get and print the Synopsis page from report
#   7. Unreserve ports
#   8. Logout


#================

########################################
import time, sys, os
# Import corresponding BPS RESTv2 python2.7/ 3 library from outside the folder with samples.
sys.path.insert(1, os.path.dirname(os.getcwd()))

from bps_restpy.bps import BPS, pp

########################################


########################################
# Demo script global variables
########################################
# Demo script global variables
canned_test_name = 'AppSim'
#bps system info
bps_system  = '<BPS_BOX_IP/HOSTNAME>'
bpsuser     = 'bps user'
bpspass     = 'bps pass'


slot_number = 2
port_list   = [0, 1]

########################################


########################################
# Login to BPS box
bps = BPS(bps_system, bpsuser, bpspass)
bps.login()


########################################
print("Load a canned test: ")
bps.testmodel.load(canned_test_name)

########################################
print("Reserve Ports")
for p in port_list:
    bps.topology.reserve([{'slot': slot_number, 'port': p, 'group': 2}])


########################################
print("Run test and Get Stats:")
test_id_json = bps.testmodel.run(modelname=canned_test_name, group=2)
testid = str( test_id_json["runid"] )
run_id = 'TEST-' + testid
print("Test Run Id: %s"%run_id)

#get the ids for all tests running on the chassis
runningTests_Ids = [test['id'] for  test in bps.topology.runningTest.get()] 
#wait while the test is still running
while run_id in runningTests_Ids:
     run_state =  bps.topology.runningTest[run_id].get()
     #print progress if test started
     try: print ('progress: %s%% , runtime %ss' % (run_state['progress'], run_state['runtime'] ))
     except: print ("Starting...")
     time.sleep(2)
     #update the current running tests
     runningTests_Ids = [test['id'] for  test in bps.topology.runningTest.get()] 

print("~The test finished the execution.")
results = bps.reports.search(searchString=canned_test_name, limit=10, sort="endTime", sortorder="descending")
result  = results[0]
print ("%s execution duration %s ended with status: %s " % (result['name'], result['duration'], result['result']) )

#getting 3.4 Section: Synopsys Summary of Results from the Report
tabledata = bps.reports.getReportTable(runid=testid, sectionId="3.4")
pp(tabledata)

print ("Unreserving the ports")
for p in port_list:
    bps.topology.unreserve([{'slot': slot_number, 'port': p, 'group': 2}])

bps.logout()
```
wew
## Documentation
Documentation is available using the following methods:
* [Online web based documentation and samples](https://github.com/OpenIxia/BreakingPoint)
* On your BreakingPoint System RestApi found near the BreakingPoint App
* Documentation available in the online doc browser is also inlined in each class, property and method and can be viewed using the python help command
  ```python
  from bps_restpy.bps import BPS, pp
  
  #login to your Breaking Point System
  help(BPS)
  bps = BPS('your_bps_IP_or_FQDN', 'admin', 'admin')
  
  help(bps.testmodel.importModel)
  
  ```

## Additional Samples
Visit the [OpenIxia breakingpoint-restpy sample site maintained by solution architects](https://github.com/OpenIxia/BreakingPoint) for in depth end-to-end samples that demonstrate the following:
* building a configuration
    * from scratch
    * from an existing BreakingPoint configuration
* running the configuration
    * connecting ports to hardware
    * starting protocols
    * starting traffic
* getting statistics
    * port stats
    * traffic stats


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "bps-restpy",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "bps, rest, api, bps-rest-api-wrapper",
    "author": null,
    "author_email": "Keysight <support@keysight.com>",
    "download_url": "https://files.pythonhosted.org/packages/20/ac/8b5f70a0e66f0606a609c2ab46e39680fe90f490d2780260a2606df13f45/bps_restpy-10.70.33.tar.gz",
    "platform": null,
    "description": "## The BreakingPoint RESTv2 API Python Wrapper\r\n[![pypi](https://img.shields.io/pypi/v/bps-restpy.svg)](https://pypi.org/project/bps-restpy)\r\n[![python](https://img.shields.io/pypi/pyversions/bps-restpy.svg)](https://pypi.python.org/pypi/bps-restpy)\r\n[![license](https://img.shields.io/badge/license-MIT-green.svg)](https://en.wikipedia.org/wiki/MIT_License)\r\n[![downloads](https://pepy.tech/badge/bps-restpy)](https://pepy.tech/project/bps-restpy)\r\n\r\n## BreakingPoint detail\r\nNetwork testing with  [BreakingPoint\u00ae](https://www.ixiacom.com/products/network-security-testing-breakingpoint). By simulating real-world legitimate traffic, distributed denial of service (DDoS), exploits, malware, and fuzzing, BreakingPoint validates an organization\u2019s security infrastructure, reduces the risk of network degradation by almost 80%, and increases attack readiness by nearly 70%. And with our new TrafficREWIND solution, you'll get even more realistic and high-fidelity validation by adding production network insight into BreakingPoint test traffic configuration\r\nMore details:\r\n\r\n## Install the package\r\n```\r\npip install --upgrade bps-restpy\r\n```\r\n\r\n## Start scripting\r\n```python\r\n\"\"\"This script demonstrates how to get started with bps_restpy scripting.\r\n\r\n# Title:  Python Script Sample To Run a Canned Test.\r\n# Actions:\r\n#   1. Login to BPS box\r\n#   2. Reserve ports\r\n#   3. Load a test from the box and start the run\r\n#   4. Wait for the test to finish\r\n#   5. Get test result\r\n#   6. Get and print the Synopsis page from report\r\n#   7. Unreserve ports\r\n#   8. Logout\r\n\r\n\r\n#================\r\n\r\n########################################\r\nimport time, sys, os\r\n# Import corresponding BPS RESTv2 python2.7/ 3 library from outside the folder with samples.\r\nsys.path.insert(1, os.path.dirname(os.getcwd()))\r\n\r\nfrom bps_restpy.bps import BPS, pp\r\n\r\n########################################\r\n\r\n\r\n########################################\r\n# Demo script global variables\r\n########################################\r\n# Demo script global variables\r\ncanned_test_name = 'AppSim'\r\n#bps system info\r\nbps_system  = '<BPS_BOX_IP/HOSTNAME>'\r\nbpsuser     = 'bps user'\r\nbpspass     = 'bps pass'\r\n\r\n\r\nslot_number = 2\r\nport_list   = [0, 1]\r\n\r\n########################################\r\n\r\n\r\n########################################\r\n# Login to BPS box\r\nbps = BPS(bps_system, bpsuser, bpspass)\r\nbps.login()\r\n\r\n\r\n########################################\r\nprint(\"Load a canned test: \")\r\nbps.testmodel.load(canned_test_name)\r\n\r\n########################################\r\nprint(\"Reserve Ports\")\r\nfor p in port_list:\r\n    bps.topology.reserve([{'slot': slot_number, 'port': p, 'group': 2}])\r\n\r\n\r\n########################################\r\nprint(\"Run test and Get Stats:\")\r\ntest_id_json = bps.testmodel.run(modelname=canned_test_name, group=2)\r\ntestid = str( test_id_json[\"runid\"] )\r\nrun_id = 'TEST-' + testid\r\nprint(\"Test Run Id: %s\"%run_id)\r\n\r\n#get the ids for all tests running on the chassis\r\nrunningTests_Ids = [test['id'] for  test in bps.topology.runningTest.get()] \r\n#wait while the test is still running\r\nwhile run_id in runningTests_Ids:\r\n     run_state =  bps.topology.runningTest[run_id].get()\r\n     #print progress if test started\r\n     try: print ('progress: %s%% , runtime %ss' % (run_state['progress'], run_state['runtime'] ))\r\n     except: print (\"Starting...\")\r\n     time.sleep(2)\r\n     #update the current running tests\r\n     runningTests_Ids = [test['id'] for  test in bps.topology.runningTest.get()] \r\n\r\nprint(\"~The test finished the execution.\")\r\nresults = bps.reports.search(searchString=canned_test_name, limit=10, sort=\"endTime\", sortorder=\"descending\")\r\nresult  = results[0]\r\nprint (\"%s execution duration %s ended with status: %s \" % (result['name'], result['duration'], result['result']) )\r\n\r\n#getting 3.4 Section: Synopsys Summary of Results from the Report\r\ntabledata = bps.reports.getReportTable(runid=testid, sectionId=\"3.4\")\r\npp(tabledata)\r\n\r\nprint (\"Unreserving the ports\")\r\nfor p in port_list:\r\n    bps.topology.unreserve([{'slot': slot_number, 'port': p, 'group': 2}])\r\n\r\nbps.logout()\r\n```\r\nwew\r\n## Documentation\r\nDocumentation\u00a0is available using the following methods:\r\n* [Online web based documentation and samples](https://github.com/OpenIxia/BreakingPoint)\r\n* On your BreakingPoint System RestApi found near the BreakingPoint App\r\n* Documentation available in the online doc browser is also inlined in each class, property and method and can be viewed using the python help command\r\n  ```python\r\n  from bps_restpy.bps import BPS, pp\r\n  \r\n  #login to your Breaking Point System\r\n  help(BPS)\r\n  bps = BPS('your_bps_IP_or_FQDN', 'admin', 'admin')\r\n  \r\n  help(bps.testmodel.importModel)\r\n  \r\n  ```\r\n\r\n## Additional Samples\r\nVisit the [OpenIxia\u00a0breakingpoint-restpy\u00a0sample site maintained by solution architects](https://github.com/OpenIxia/BreakingPoint) for\u00a0in\u00a0depth\u00a0end-to-end\u00a0samples\u00a0that\u00a0demonstrate\u00a0the\u00a0following:\r\n* building\u00a0a\u00a0configuration\r\n    * from\u00a0scratch\r\n    * from\u00a0an\u00a0existing\u00a0BreakingPoint\u00a0configuration\r\n* running\u00a0the\u00a0configuration\r\n    * connecting\u00a0ports\u00a0to\u00a0hardware\r\n    * starting\u00a0protocols\r\n    * starting\u00a0traffic\r\n* getting\u00a0statistics\r\n    * port\u00a0stats\r\n    * traffic\u00a0stats\r\n\r\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2018 OpenIxia  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "BreakingPoint REST API Python Wrapper",
    "version": "10.70.33",
    "project_urls": {
        "Homepage": "https://github.com/OpenIxia/BreakingPoint"
    },
    "split_keywords": [
        "bps",
        " rest",
        " api",
        " bps-rest-api-wrapper"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4436097ec892beb0388070d9ed32cd1ae3c0793065abb5d5b2ff575c5ed6601f",
                "md5": "13db4063d2b6dd6e102e7462f23eed7b",
                "sha256": "19a3a94b2a93480fb44bec77f3d0251d42efe06c1540109c1b3c87266b21be89"
            },
            "downloads": -1,
            "filename": "bps_restpy-10.70.33-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "13db4063d2b6dd6e102e7462f23eed7b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 120301,
            "upload_time": "2024-12-21T01:17:19",
            "upload_time_iso_8601": "2024-12-21T01:17:19.783814Z",
            "url": "https://files.pythonhosted.org/packages/44/36/097ec892beb0388070d9ed32cd1ae3c0793065abb5d5b2ff575c5ed6601f/bps_restpy-10.70.33-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "20ac8b5f70a0e66f0606a609c2ab46e39680fe90f490d2780260a2606df13f45",
                "md5": "6acd9a35da0330ea1297acc0aa3979ed",
                "sha256": "18fbb91d487b6a869f614aba612ef6549628708f0b1df7156b66cd7f4e4226fe"
            },
            "downloads": -1,
            "filename": "bps_restpy-10.70.33.tar.gz",
            "has_sig": false,
            "md5_digest": "6acd9a35da0330ea1297acc0aa3979ed",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 97453,
            "upload_time": "2024-12-21T01:17:21",
            "upload_time_iso_8601": "2024-12-21T01:17:21.976227Z",
            "url": "https://files.pythonhosted.org/packages/20/ac/8b5f70a0e66f0606a609c2ab46e39680fe90f490d2780260a2606df13f45/bps_restpy-10.70.33.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-21 01:17:21",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "OpenIxia",
    "github_project": "BreakingPoint",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "bps-restpy"
}
        
Elapsed time: 0.47407s