V2 API is not scheduling configuration jobs

Hello!

I looked around the forums and haven’t seen anything similar to the issue I’m facing, so hopefully this post isn’t redundant.

I wrote some automation a couple of years ago which programmatically provisioned PMP450 radios out of our billing system using the cnMaestro v1 API devices endpoint, and it was set off to the side until now.

I have been testing to re-validate the workflow now that we’re actually getting around to deploying the solution and found that the v1 API is now deprecated, so I advanced to using the v2 tag - generally speaking this hasn’t resulted in any changes except in the PUT verb for devices, i.e. https://cnmaestro.example.net/api/v2/devices/{mac}

In the v1 API I make a call like:

>>> json = {'name': 'tower-router-test-esm', 'template': 'PMP450-57-nat', 'variables': {'QOS_SUST_DNLINK_RATE': '12000', 'QOS_SUST_UPLINK_RATE': '2000', 'QOS_DNLINK_BURST': '540000', 'QOS_UPLINK_BURST': '2000', 'QOS_MAX_DNLINK_RATE': '18000', 'QOS_MAX_UPLINK_RATE': '2000', 'HI_PRIO_DL_CIR': '0', 'HI_PRIO_UL_CIR': '0', 'SITE_NAME': 'tower-router-test-esm', 'COLOR_CODE_1': '47'}} 

>>> headers = {
    'Content-Type': "application/json",
    'Accept': "application/json",
    'Authorization': connector['BEARER_TOKEN']
}
>>> res = requests.put(
    'https://cnmaestro.example.net/api/v1/devices/{}'.format('0A:00:3E:12:34:56'),
    json=json,
    headers=headers
).json()

and receive a success reply from cnMaestro like:

>>> res
{'message': "Job created successfully.  Please check the job's status for details.", 'job_id': 'afb2da5e-8502-4578-8096-6694b81f7688', 'state': 'started', 'deprecation': {'message': 'The v1 version of this API is deprecated and must be changed to v2.', 'sunset': '3.2.0', 'specification': 'https://docs.cloud.cambiumnetworks.com/api/3.0.0/announcements.html'}}

and I can then view the job in the cnMaestro UI and watch the settings be pushed successfully to the radio - works great and as expected.

However, if I simply update that request to the v2 API I instead receive the following very skimpy reply:

>>> res
{'message': 'Success'}

and then nothing happens - no job is scheduled, no changes are applied to the radio, etc.

The swagger documentation is, let’s be honestly, extraordinarily slim and doesn’t cover optional parameters whatsoever, and there isn’t anything in the cnMaestro user guide about programmatically applying configuration templates through the API either - everything is geared towards manually doing things in the UI.

Was this configuration template feature nerfed via the API, was the request inherently changed, is there a paywall to doing this now? I have been through change announcements for cnMaestro 3.0.0 + and haven’t seen a note about operational changes to this action and am thoroughly confused at this point. Something has obviously changed, I just don’t know if it’s intentional or not or how I can resolve this issue.

Thank you!

Jacob Barnard

6 Likes

Hi @Jacob_Barnard,

This behavior is not a planned changed. If a job is created by an API call then the job details should be included in the response.

I tested this locally with a 3.1.1 build and got the expected response with the v2 API that includes message, job_id and state. I’m going through our bug tracker to see if this was a known issue that was fixed.

Which cnMaestro version are you using? 3.0.0, 3.1.0?

Thank you,
Jordan

We verified that the correct response is also received using version 3.1.0-r77 on cloud.

Hey Jordan!

Apologies for the late reply - I did not receive a notification from the forum. We are running an on-premise instance at version 3.0.0-r34 at this time.

Thank you,
Jacob

Hi @Jacob_Barnard,

I checked our bug tracker but did not find anything directly related to the issue you’re having being fixed in 3.1.0. Without more info I suspect this is something that was fixed in 3.1.0 so I recommend you upgrade your cnMaestro instance.

If you still experience this issue please contact customer support.

Thank you,
Jordan

Hey Jordan,

We’ll give it a shot and post a follow-up issue if this does not correct the behavior.

Thanks!

Jacob

1 Like