Introduction

Overview of BQN REST API used to manage BQN traffic optimization features.

The BQN REST API is a Representational State Transfer (REST) interface that securely connects to a BQN device to get information and control some of its traffic optimization features.

Access

The BQN REST API uses HTTPS to exchange encrypted content formatted in JSON. By default, the BQN listens at TCP port 3443 on its management interface and IP address.

Authentication

The BQN REST API supports the HTTP Basic Authentication scheme (described in RFC 7617), where all requests include an Authorization header with a base64-encoded username and password. Valid usernames and passwords must be configured in the BQN server.

The BQN accepts requests from any client IP address or, if a list of client IP addresses is provided, from clients in that list only.

You can configure a certificate in the BQN (see at the end of this section ). If the default certificate is used, it is a self-signed certificate because the server IP address is deployment dependant. In those cases, you should set the requests to not validate the server certificate. For example, with curl, the -k option is used:

curl -k --request GET \
     --url https://some.bqn.net:3443/api/v1/policies/rate/policyName \
     --header 'accept: application/json' \
     --header 'authorization: Basic bXl1c2VyOm15cGFzc3dvcmQ='

And with python requests the verify=False parameter:

import requests

url = "https://some.bqn.net:3443/api/v1/policies/rate/policyName"

headers = {
    "accept": "application/json",
    "authorization": "Basic bXl1c2VyOm15cGFzc3dvcmQ="
}

response = requests.get(url, headers=headers, verify=False)

print(response.text)

Configuration

The REST API is disabled by default. As a minimum, a username and password must be created and the REST API enabled. See here for more details.

Endpoints

The API HTTPS requests must be sent to a specific version endpoint URL. The current version is Version 1. The base URL for Version 1 is:

https://<bqn-ip>:<port>/api/v1

where <bqn-ip> is the management IP address of the BQN and <port> is the configured port for the REST API service (3443 by default).

HTTP Methods

The following HTTP methods are used:

  • GET: Retrieves the specified resource. It is a read-only operation that does not change any server state or parameters.
  • DELETE: Deletes a resource.
  • POST: Creates the specified resource. The data in the request body contains the information for the new resource. If the resource already exists, it is updated with the new data and the rest of the resource data is reset (set to its default state).
  • PUT: Updates the specified resource with the provided data. The rest of the resource data is unchanged.

Next

The rest of this document describes the different endpoints and methods, and provides code examples in curl and python. When using automatically generated sample code for other languages, please bear in mind that the BQN uses a self-signed certificate and therefore the requests should not check its validity.