API: Gateway modules

From Yombo
Jump to: navigation, search

Summary

Display and manage modules installed on a gateway. Modules extend the functionality of gateways by adding new protocols or logic.

GET - List gateway modules

Get all modules assigned to a gateway.

Filters

List of available filters:

  • status

Request URLs

  • GET https://api.yombo.net/api/v1/gateway/{gateway_id}/module

Parameters

None

Example

  <div id="curl<random_number></random_number>" class="tab-pane fade in active" style="border: 1px solid #ccc; border-radius: 5px; padding: 0.7em;">
curl \
-H "x-api-key: abc123xyz789" \
-H "authorization: Bearer Waro7g0Mwl4YBJ..." \
https://api.yombo.net/api/v1/gateway/PZywd7j0VLR4PzWz/module?_pagelimit=1
  <div id="python<random_number></random_number>" class="tab-pane fade" style="border: 1px solid #ccc; border-radius: 5px; padding: 0.7em;">
import requests

url = 'https://api.yombo.net/api/v1/gateway/PZywd7j0VLR4PzWz/module?_pagelimit=1'
headers = {
    'x-api-key': 'abc123xyz789',
    'authorization': 'Waro7g0Mwl4YBJ...',
    }
response = requests.get(url, headers=headers)
  <div id="output<random_number></random_number>" class="tab-pane fade" style="border: 1px solid #ccc; border-radius: 5px; padding: 0.7em;">
 1 {
 2     "response": {
 3         "uri": "/api/v1/gateway/PZywd7j0VLR4PzWz/module?_pagelimit=1",
 4         "uri_description": "List of modules attached to a gateway.",
 5         "doc_uri": "https://yombo.net/API:Gateway_modules",
 6         "gateway_module": [
 7             {
 8                 "gateway_id": "PZywd7j0VLR4PzWz",
 9                 "module_id": "E2dJKdPKWRn",
10                 "install_branch": "production",
11                 "module_type": "logic",
12                 "machine_label": "Presence",
13                 "label": "Presence",
14                 "short_description": "Tracks devices to determine their location in relation to a gateway location. This module only provides a framework.",
15                 "medium_description": "",
16                 "description": "Track devices. More details to come.",
17                 "medium_description_html": null,
18                 "description_html": null,
19                 "see_also": null,
20                 "repository_link": "https://bitbucket.org/yombo/module-presence-bluetooth",
21                 "issue_tracker_link": "",
22                 "install_count": 0,
23                 "doc_link": "https://bitbucket.org/yombo/module-presence-bluetooth",
24                 "git_link": "https://bitbucket.org/yombo/module-presence-bluetooth.git",
25                 "prod_branch": "master",
26                 "dev_branch": "",
27                 "prod_version": "8f04fd359d6673e46c00",
28                 "dev_version": null,
29                 "public": 2,
30                 "created_at": 1501369614,
31                 "updated_at": 1501369614,
32                 "status": 1,
33                 "variable_groups": [],
34                 "variable_fields": [],
35                 "variable_data": [],
36                 "device_types": [
37                     {
38                         "id": "4lmEgBYemYz1yPAJ",
39                         "module_id": "E2dJKdPKWRn",
40                         "device_type_id": "n7x5vzXg",
41                         "created_at": 1499902495
42                     }
43                 ]
44             }
45         ],
46         "locator": "gateway_module",
47         "locator_type": "objects"
48     },
49     "code": 200,
50     "warnings": [],
51     "pages": {
52         "total_items": 26,
53         "page_limit": 1,
54         "total_pages": 26,
55         "page_start": 1
56     },
57     "message": "OK",
58     "html_message": "OK"
59 }

GET - Specific gateway module

Retrieve a specific module for a gateway.

Request URLs

  • GET https://api.yombo.net/api/v1/gateway/{gateway_id}/module/{module_id}

Parameters

None

Example

  <div id="curl<random_number></random_number>" class="tab-pane fade in active" style="border: 1px solid #ccc; border-radius: 5px; padding: 0.7em;">
curl \
-H "x-api-key: abc123xyz789" \
-H "authorization: Bearer Waro7g0Mwl4YBJ..." \
https://api.yombo.net/api/v1/gateway/PZywd7j0VLR4PzWz/module/E2dJKdPKWRn
  <div id="python<random_number></random_number>" class="tab-pane fade" style="border: 1px solid #ccc; border-radius: 5px; padding: 0.7em;">
import requests

url = 'https://api.yombo.net/api/v1/gateway/PZywd7j0VLR4PzWz/module/E2dJKdPKWRn'
headers = {
    'x-api-key': 'abc123xyz789',
    'authorization': 'Waro7g0Mwl4YBJ...',
    }
response = requests.get(url, headers=headers)
  <div id="output<random_number></random_number>" class="tab-pane fade" style="border: 1px solid #ccc; border-radius: 5px; padding: 0.7em;">
 1 {
 2     "response": {
 3         "uri": "/api/v1/gateway/PZywd7j0VLR4PzWz/module/E2dJKdPKWRn",
 4         "uri_description": "Detailed information for a single module installed on a gateway.",
 5         "doc_uri": "https://yombo.net/API:Gateway_modules",
 6         "gateway_module": {
 7             "gateway_id": "PZywd7j0VLR4PzWz",
 8             "module_id": "E2dJKdPKWRn",
 9             "install_branch": "production",
10             "module_type": "logic",
11             "machine_label": "Presence",
12             "label": "Presence",
13             "short_description": "Tracks devices to determine their location in relation to a gateway location. This module only provides a framework.",
14             "medium_description": "",
15             "description": "Track devices. More details to come.",
16             "medium_description_html": null,
17             "description_html": null,
18             "see_also": null,
19             "repository_link": "https://bitbucket.org/yombo/module-presence-bluetooth",
20             "issue_tracker_link": "",
21             "install_count": 0,
22             "doc_link": "https://bitbucket.org/yombo/module-presence-bluetooth",
23             "git_link": "https://bitbucket.org/yombo/module-presence-bluetooth.git",
24             "prod_branch": "master",
25             "dev_branch": "",
26             "prod_version": "8f04fd359d6673e46c00",
27             "dev_version": null,
28             "public": 2,
29             "created_at": 1501369614,
30             "updated_at": 1501369614,
31             "status": 1,
32             "variable_groups": [],
33             "variable_fields": [],
34             "variable_data": []
35         },
36         "locator": "gateway_module",
37         "locator_type": "object"
38     },
39     "code": 200,
40     "warnings": [],
41     "message": "OK",
42     "html_message": "OK"
43 }

POST - Install module

Adds a new module to be installed on the gateway.

Request URLs

  • POST https://api.yombo.net/api/v1/gateway/{gateway_id}/module

Parameters

Name Type Description
Required
module_id string Module to assign to gateway.
install_branch string Which development branch to install, one of: “production” or “development”
Optional
voice_cmd string Used by various systems to compile a possible list of voice commands for devices. This is what the person would say or type to activate the command. Usually the same as the label or machine_label.
status string Default: 1 - The status of the module. Default=1. Possible values: 0=disabled, 1=enabled, 2=mark for deletion

Example

  <div id="curl<random_number></random_number>" class="tab-pane fade in active" style="border: 1px solid #ccc; border-radius: 5px; padding: 0.7em;">
curl \
-H "x-api-key: abc123xyz789" \
-H "authorization: Bearer Waro7g0Mwl4YBJ..." \
-X POST -d '{"module_id": "3M2VK9x7q9r", "install_branch": "production"}' \
https://api.yombo.net/api/v1/gateway/PZywd7j0VLR4PzWz/module
  <div id="python<random_number></random_number>" class="tab-pane fade" style="border: 1px solid #ccc; border-radius: 5px; padding: 0.7em;">
import requests

url = 'https://api.yombo.net/api/v1/gateway/PZywd7j0VLR4PzWz/module'
headers = {
    'x-api-key': 'abc123xyz789',
    'authorization': 'Waro7g0Mwl4YBJ...',
    }

payload = {
    "module_id": "3M2VK9x7q9r",
    "install_branch": "production"
    }

response = requests.post(url, headers=headers, json=payload)
  <div id="output<random_number></random_number>" class="tab-pane fade" style="border: 1px solid #ccc; border-radius: 5px; padding: 0.7em;">
 1 {
 2     "response": {
 3         "uri": "/api/v1/gateway/PZywd7j0VLR4PzWz/module",
 4         "uri_description": "Link module to gateway.",
 5         "doc_uri": "https://yombo.net/api/#gw-modules",
 6         "gateway_module": {
 7             "module_id": "3M2VK9x7q9r",
 8             "install_branch": "production",
 9             "gateway_id": "PZywd7j0VLR4PzWz",
10             "updated_at": 1518681246,
11             "created_at": 1518681246
12         },
13         "locator": "gateway_module",
14         "locator_type": "object"
15     },
16     "code": 201,
17     "warnings": [],
18     "message": "Created",
19     "html_message": "Created"
20 }

PUT / PATCH - Update a gateway module

Update settings for a gateway module. When using PUT, all required parameters must be sent. When using PATCH, only send in desired changes.

Request URLs

  • PATCH https://api.yombo.net/api/v1/gateway/{gateway_id}/module/{module_id}
  • PUT https://api.yombo.net/api/v1/gateway/{gateway_id}/module/{module_id}

Parameters

See post new command parameters.

Example

  <div id="curl<random_number></random_number>" class="tab-pane fade in active" style="border: 1px solid #ccc; border-radius: 5px; padding: 0.7em;">
curl \
-H "x-api-key: abc123xyz789" \
-H "authorization: Bearer Waro7g0Mwl4YBJ..." \
-X PUT -d '{"install_branch": "development"}' \
https://api.yombo.net/api/v1/gateway/PZywd7j0VLR4PzWz/module/3M2VK9x7q9r
  <div id="python<random_number></random_number>" class="tab-pane fade" style="border: 1px solid #ccc; border-radius: 5px; padding: 0.7em;">
import requests

url = 'https://api.yombo.net/api/v1/gateway/PZywd7j0VLR4PzWz/module/3M2VK9x7q9r'
headers = {
    'x-api-key': 'abc123xyz789',
    'authorization': 'Waro7g0Mwl4YBJ...',
    }

payload = {
    "install_branch": "development",
    }

response = requests.put(url, headers=headers, json=payload)
  <div id="output<random_number></random_number>" class="tab-pane fade" style="border: 1px solid #ccc; border-radius: 5px; padding: 0.7em;">
 1 {
 2     "response": {
 3         "uri": "/api/v1/gateway/PZywd7j0VLR4PzWz/module/3M2VK9x7q9r",
 4         "uri_description": "Update gateway module.",
 5         "doc_uri": "https://yombo.net/API:Gateway_modules",
 6         "gateway_module": {
 7             "gateway_id": "PZywd7j0VLR4PzWz",
 8             "module_id": "3M2VK9x7q9r",
 9             "install_branch": "development",
10             "module_type": "interface",
11             "machine_label": "InsteonPLM",
12             "label": "Insteon PLM",
13             "short_description": "A Yombo Module that adds support for sending Insteon commands to the power lines through a USB or serial port. An Insteon API module is required.",
14             "medium_description": "A Yombo Module that adds support for sending Insteon commands to the power lines through a USB or serial port. An Insteon API module is required.\r\n\r\n* asdf\r\n* zxcv",
15             "description": "= Summary =\r\nA Yombo module that adds support for sending Insteon commands to the power lines through a USB or serial port. An Insteon API module is required.\r\n\r\n= Usage=\r\nThis module is an interface module between the Insteon API module and an Insteon PLM. The Insteon API module is required before this module can be used.\r\n\r\n= Installation = \r\nFrom the Gateway web interface (or other application), simply mark this module as being used by the gateway, and the gateway will download and install this module automatically.\r\n\r\n= Requirements =\r\nAn Insteon interface module is required to send commands to Insteon devices.\r\n\r\n= License =\r\n\r\nSee LICENSE.md in reposiorty for full details.\r\n\r\nThis module is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\r\n\r\nThe GNU General Public License can be found here: [http://www.gnu.org/licenses GNU.Org]\r\n\r\nThe [https://yombo.net Yombo] team and other contributors hopes that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.",
16             "medium_description_html": "<p>A Yombo Module that adds support for sending Insteon commands to the power lines through a USB or serial port. An Insteon API module is required.</p>\n<ul><li>asdf</li>\n<li>zxcv</li>\n</ul>",
17             "description_html": "<h1>Summary</h1>\n<p>A Yombo module that adds support for sending Insteon commands to the power lines through a USB or serial port. An Insteon API module is required.</p>\n<h1>Usage</h1>\n<p>This module is an interface module between the Insteon API module and an Insteon PLM. The Insteon API module is required before this module can be used.</p>\n<h1>Installation</h1>\n<p>From the Gateway web interface (or other application), simply mark this module as being used by the gateway, and the gateway will download and install this module automatically.</p>\n<h1>Requirements</h1>\n<p>An Insteon interface module is required to send commands to Insteon devices.</p>\n<h1>License</h1>\n<p>See LICENSE.md in reposiorty for full details.</p>\n<p>This module is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.</p>\n<p>The GNU General Public License can be found here: <a class=\"external text\" href=\"http://www.gnu.org/licenses\">GNU.Org</a></p>\n<p>The <a class=\"external text\" href=\"https://yombo.net\">Yombo</a> team and other contributors hopes that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</p>",
18             "see_also": null,
19             "repository_link": "https://github.com/yombo/module-insteonplm",
20             "issue_tracker_link": "https://github.com/yombo/module-insteonplm/issues",
21             "install_count": 0,
22             "doc_link": "https://yombo.net/modules/insteonplm",
23             "git_link": "https://github.com/yombo/module-insteonplm.git",
24             "prod_branch": "master",
25             "dev_branch": "",
26             "prod_version": "278d0504f4d7a1b59bc1",
27             "dev_version": null,
28             "public": 2,
29             "created_at": 1518681523,
30             "updated_at": 1518681567,
31             "status": 1
32         },
33         "locator": "gateway_module",
34         "locator_type": "object"
35     },
36     "code": 200,
37     "warnings": [],
38     "message": "Updated",
39     "html_message": "Updated"
40 }

DELETE - Uninstall module

Uninstall a module from a gateway. This will also delete any variable data assigned to this module.

Request URLs

  • DELETE https://api.yombo.net/api/v1/gateway/{gateway_id}/module/{module_id}

Parameters

None

Example

  <div id="curl<random_number></random_number>" class="tab-pane fade in active" style="border: 1px solid #ccc; border-radius: 5px; padding: 0.7em;">
curl \
-H "x-api-key: abc123xyz789" \
-H "authorization: Bearer Waro7g0Mwl4YBJ..." \
-X DELETE https://api.yombo.net/api/v1/gateway/PZywd7j0VLR4PzWz/module/3M2VK9x7q9r
  <div id="python<random_number></random_number>" class="tab-pane fade" style="border: 1px solid #ccc; border-radius: 5px; padding: 0.7em;">
import requests

url = 'https://api.yombo.net/api/v1/gateway/PZywd7j0VLR4PzWz/module/3M2VK9x7q9r'
headers = {
    'x-api-key': 'abc123xyz789',
    'authorization': 'Waro7g0Mwl4YBJ...',
    }

response = requests.put(url, headers=headers)
  <div id="output<random_number></random_number>" class="tab-pane fade" style="border: 1px solid #ccc; border-radius: 5px; padding: 0.7em;">
 1 {
 2     "response": {
 3         "uri": "/api/v1/gateway/PZywd7j0VLR4PzWz/module/3M2VK9x7q9r",
 4         "uri_description": "Gateway mdoule deleted",
 5         "doc_uri": "https://yombo.net/API:Gateway_modules",
 6         "gateway_module": "Deleted",
 7         "locator": "gateway_module",
 8         "locator_type": "string"
 9     },
10     "code": 200,
11     "warnings": [],
12     "message": "Deleted",
13     "html_message": "Deleted"
14 }
This page was last edited on 14 September 2018.