Skip to main content

The BreakingPoint RESTv2 API Python Wrapper

pypi python license downloads

BreakingPoint detail

Network testing with 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

"""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
  • 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
    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 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

Metadata

Release files for bps-restpy 10.0.100030007

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

Source distribution (sdist)

Source distribution for bps-restpy 10.0.100030007
File Size Uploaded Provenance Actions
bps_restpy-10.0.100030007.tar.gz 95.2 kB Without provenance Details for bps_restpy-10.0.100030007.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bps-restpy 10.0.100030007
File Interpreter ABI Platform Actions
bps_restpy-10.0.100030007-py3-none-any.whl Python 3 none any Details for bps_restpy-10.0.100030007-py3-none-any.whl

Total release size: 213.8 kB

Release files / bps_restpy-10.0.100030007.tar.gz

Download URL bps_restpy-10.0.100030007.tar.gz
Size 95.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7fca06c648c0754e8cdb353c6e9b64239bae9a9dd00619f318e3028e129ff1b7
BLAKE2b-256 checksum
How to use checksums
4036e84c71cb21e50ca41829b462138f4fc8174be768f6e5262b610705778a6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.11.9

Release files / bps_restpy-10.0.100030007-py3-none-any.whl

Download URL bps_restpy-10.0.100030007-py3-none-any.whl
Size 118.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
24bae900bba898c00e621e5a1d143d6894819bfec00c3ba1964b5793c72ed369
BLAKE2b-256 checksum
How to use checksums
292dad906fcfc5a4c3f962c99d2d5cd5d7720fcfaee056d49d8c9b72a02b311c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.11.9

Security for bps-restpy 10.0.100030007

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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