cnWave 60 GHz Network API Guide
This guide offers straightforward instructions for developers and network administrators on using the cnWave 60 GHz network’s API. It details the steps to obtain API credentials and execute the attached
sample Python script to create sites, nodes and links.
api_sample_usage.zip (3.4 KB)
GETTING STARTED
Before executing the script, ensure Python is installed on your system, and you’ve obtained the necessary API credentials: client_id and client_secret.
Prerequisites:
- Python 3.x
- requests library
- Access to cnMaestro cloud with a Super Admin account in cnMaestro X
Installing:
Ensure Python is installed by checking its version with either of the following
commands, depending on your system:
python3 --version
Install the requests
library using pip:
pip3 install requests
Obtaining API Credentials:
- Log in to cnMaestro cloud as a Super Admin, ensuring you’re on a cnMaestro X account.
- Navigate to Network Services → API Client.
- Click on “Add new API client,” fill in the details, and save. You’ll then see the “OAuth 2.0 Access Credentials” section.
- Download the credentials as a JSON file or copy them directly from the screen.
Configuring the Script:
After securing your credentials, prepare the input_data.json
with your network’s specifics:
- Open
input_data.json
in a text editor. - Replace
your_client_id
andyour_client_secret
with the actual credentials. - Replace ‘your_network_id’ with the E2E network id
- Update placeholders in the “sites”, “nodes”, and “links” sections with your network configuration details. This encompasses
name
,latitude
,longitude
,altitude
, andaccuracy
for sites;name
,pop
,azimuth
,elevation
,mode
,site
,msn
, andmodel
for nodes; andname
,a_node_name
,a_node_mac
,z_node_name
,z_node_mac
, andlink_type
for links. To calculatea_node_mac
andz_node_mac
for sector 1, add 12 to the first octet of the node’s MAC address; for sector 2, add 22. - Confirm the
cn_maestro_url
andnetwork_id
align with your cnWave 60 GHz network setup.
Running the Script:
Execute the script with the following command in your terminal or command prompt:
python3 site_node_link.py
API DESCRIPTION
The script communicates with cnWave’s APIs for site, node, and link creation, with detailed documentation available through Cambium Networks’ Swagger instance. Briefly:
-
Create Site API:
/cnwave/60/networks/{network_id}/sites
- POST method to create a new site with details like name and location. -
Create Node API:
/cnwave/60/devices
- POST method registers a new node device to the network. The request includes details about the node, such as its name, whether it is a pop, azimuth, elevation, mode (DN or CN), associated site, Serial number (cloud cnMaestro) or MAC address (on prem cnMaestro), and model. -
Create Link API:
/cnwave/60/networks/{network_id}/links
- POST method for establishing a link between two nodes, requiring names and MAC addresses.
For comprehensive API details, including parameters and responses, visit: Cambium Networks Swagger documentation
Accessing the Network Services → API Client in cnMaestro cloud and using the “Try It Out” button also directs you to an interactive documentation.