bps-restpy


Namebps-restpy JSON
Version 11.0.0 PyPI version JSON
download
home_pagehttps://github.com/OpenIxia/bps_restpy
SummaryBreakingPoint REST API Python Wraper
upload_time2025-08-03 18:52:01
maintainerNone
docs_urlNone
authorKeysight ISG BreakingPoint Team
requires_python<4,>=2.7
licenseMIT
keywords bps breakingpoint security network test tool ixia keysight automation
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": "https://github.com/OpenIxia/bps_restpy",
    "name": "bps-restpy",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4,>=2.7",
    "maintainer_email": null,
    "keywords": "bps breakingpoint security network test tool ixia keysight automation",
    "author": "Keysight ISG BreakingPoint Team",
    "author_email": "constantin.cretu@keysight.com",
    "download_url": "https://files.pythonhosted.org/packages/72/5a/76a5fd295a25a6d4640747912ccb59d417b82b63d9072fc6441110fdcf45/bps_restpy-11.0.0.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\u00c2\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\u00e2\u20ac\u2122s 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\u00c2\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\u00c2\u00a0breakingpoint-restpy\u00c2\u00a0sample site maintained by solution architects](https://github.com/OpenIxia/BreakingPoint) for\u00c2\u00a0in\u00c2\u00a0depth\u00c2\u00a0end-to-end\u00c2\u00a0samples\u00c2\u00a0that\u00c2\u00a0demonstrate\u00c2\u00a0the\u00c2\u00a0following:\r\n* building\u00c2\u00a0a\u00c2\u00a0configuration\r\n  * from\u00c2\u00a0scratch\r\n  * from\u00c2\u00a0an\u00c2\u00a0existing\u00c2\u00a0BreakingPoint\u00c2\u00a0configuration\r\n* running\u00c2\u00a0the\u00c2\u00a0configuration\r\n  * connecting\u00c2\u00a0ports\u00c2\u00a0to\u00c2\u00a0hardware\r\n  * starting\u00c2\u00a0protocols\r\n  * starting\u00c2\u00a0traffic\r\n* getting\u00c2\u00a0statistics\r\n  * port\u00c2\u00a0stats\r\n  * traffic\u00c2\u00a0stats\r\n\r\n\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "BreakingPoint REST API Python Wraper",
    "version": "11.0.0",
    "project_urls": {
        "Homepage": "https://github.com/OpenIxia/bps_restpy"
    },
    "split_keywords": [
        "bps",
        "breakingpoint",
        "security",
        "network",
        "test",
        "tool",
        "ixia",
        "keysight",
        "automation"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "0ecfee0d136d6636aa30ad8244016008947e2aa62093459b008ece7c2b5c5c13",
                "md5": "499c2d34575ac974a1dc635a558aaaf0",
                "sha256": "35a8530769dc2737cbf0d27b22b936fd1154622b5b48a9f3db4f55de82e75e6c"
            },
            "downloads": -1,
            "filename": "bps_restpy-11.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "499c2d34575ac974a1dc635a558aaaf0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4,>=2.7",
            "size": 123242,
            "upload_time": "2025-08-03T18:51:59",
            "upload_time_iso_8601": "2025-08-03T18:51:59.843085Z",
            "url": "https://files.pythonhosted.org/packages/0e/cf/ee0d136d6636aa30ad8244016008947e2aa62093459b008ece7c2b5c5c13/bps_restpy-11.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "725a76a5fd295a25a6d4640747912ccb59d417b82b63d9072fc6441110fdcf45",
                "md5": "64ecf5100ec900585557db700de02c8b",
                "sha256": "2f7e9c00975f5bee2b7c4dc3fe3a24463c9aff3f6ba48f6c1b8ddea07a27e971"
            },
            "downloads": -1,
            "filename": "bps_restpy-11.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "64ecf5100ec900585557db700de02c8b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4,>=2.7",
            "size": 101191,
            "upload_time": "2025-08-03T18:52:01",
            "upload_time_iso_8601": "2025-08-03T18:52:01.116636Z",
            "url": "https://files.pythonhosted.org/packages/72/5a/76a5fd295a25a6d4640747912ccb59d417b82b63d9072fc6441110fdcf45/bps_restpy-11.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-03 18:52:01",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "OpenIxia",
    "github_project": "bps_restpy",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "bps-restpy"
}
        
Elapsed time: 1.17568s