Coder Social home page Coder Social logo

sensepost / bvapi Goto Github PK

View Code? Open in Web Editor NEW
2.0 6.0 1.0 112 KB

Deprecated BroadView API Client - see https://bitbucket.org/checksec/bvapi

Home Page: https://bitbucket.org/checksec/bvapi

License: BSD 2-Clause "Simplified" License

Python 100.00%

bvapi's Introduction

BroadView API Client

A basic library to interface with SensePost BroadView Servers.

Basic Usage

>>> import bvapi
>>> client = bvapi.Client(url="https://yourbroadviewserver/api/v1", user="yourusername", password="yourpassword")
>>> client.status()
{u'status': u'success', u'current_time': u'2013-03-27T09:01:52.842965+02:00', u'instance_url': u'unconfigured', u'version': u'v1', u'user': u'admin'}

API Details

Each API call returns a dictionary, unless an error occrus in which case an exception is raised. This dictionary will contain the data requested and possible additionaly information, see the API methods for which keys will be populated with the requested data. Since this library interfaces with a JSON API it will return only basic types(lists, dicts, strings, integers etc). All dates and times will be in ISO 8601 Format with a timezone.

API Methods

status()

Used to determine if server is currently serving requests and if authentication succeeds. It also returns the following info:

  • current_time The server's current time in ISO 8601 format including timezone.
  • instance_url The URL for the servers web interface if configured.
  • version The version of the API at the queried location.
  • user The name of the user used in the request.

accounts()

Returns all the accounts the user can access in the 'accounts' key.

jobs(account_id)

Return all the jobs for the specified account_id in the 'jobs' key. Order is descending.

scans(job_id, [count])

Returns the last scans for the specified job_id in the 'scans' key. Order is descending. An optional count parameter may be given to control the amount of scans returned. The server will impose a maximum count.

scan_data(scan_id)

Return the scan requested with its issues. The scan will be a dictionary under the 'scan' key, it will contain a key named 'issues' with the scans issues.

Exceptions

Any error will generate an exception derived from bvapi.exceptions.ApiException or it will be an exception generated by a dependency such as requests(If the connections fails etc). The following exceptions are defined:

NotAuthorisedError

User was not authorized to perform the API call or access the specified resource.

NotFoundError

The specified resource was not found.

License

See the file LICENSE for full license text.

Copyright SensePost Pty Ltd 2013

bvapi's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.