Library: yomboapi

From Yombo
Jump to: navigation, search
Commonly Used No
Status Active

Make calls to the Yombo API.


Responsible for interacting with the Yombo API. It can login, fetch results, and make changes through the API system.


No hooks registered.


The Yombo API is the heart of the system. Through it, commands can be sent or configuration changes can me made, as well as, adding or deleting gateways, and configuring gateway clusters.

For developers, the primary function developers will use it self._YomboAPI.request(). Unless a specific user session is required, the system will use the gateway owner's information to make changes.


To request a create a new command:

 1 new_command = {
 2     'machine_label': 'my_command_is_cool',
 3     'label': 'My cool command',
 4     'description': 'Does really cool things.',
 5     '_idempotentcy_key': 'create_my_command_123',  # can be whatever you want
 6 }
 8 try:
 9     command_results = yield self._YomboAPI.request('POST', '/v1/command', data)
10 except YomboAPIWarning as e:
11     results = {
12         'status': 'failed',
13         'msg': "Couldn't add command: %s" % e.message,
14         'apimsg': "Couldn't add command: %s" % e.message,
15         'apimsghtml': "Couldn't add command: %s" % e.html_message,
16     }
17     return results

This page was last edited on 9 December 2017.