diff options
| author | omnom62 <omnom62@outlook.com> | 2026-06-04 06:34:07 +1000 |
|---|---|---|
| committer | omnom62 <omnom62@outlook.com> | 2026-06-04 06:34:07 +1000 |
| commit | 1d563009815dbbf6eeeb368ef14edc6f5ce4a2a2 (patch) | |
| tree | 8aa088069119b0ef0d30543379230f4584d2e0c4 /plugins/httpapi | |
| parent | ba080f20749a7c79dc3033e5e022e3ccb00c65c5 (diff) | |
| download | rest.vyos-1d563009815dbbf6eeeb368ef14edc6f5ce4a2a2.tar.gz rest.vyos-1d563009815dbbf6eeeb368ef14edc6f5ce4a2a2.zip | |
Sanity fixes
Diffstat (limited to 'plugins/httpapi')
| -rw-r--r-- | plugins/httpapi/vyos.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/plugins/httpapi/vyos.py b/plugins/httpapi/vyos.py index 6dd6042..07a60fe 100644 --- a/plugins/httpapi/vyos.py +++ b/plugins/httpapi/vyos.py @@ -1,6 +1,5 @@ -#!/usr/bin/python # -*- coding: utf-8 -*- -# GNU General Public License v3.0+ +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function @@ -90,13 +89,14 @@ class HttpApi(HttpApiBase): ) return key - def send_request(self, endpoint, **payload): + def send_request(self, data, **payload): # pylint: disable=arguments-renamed """POST to a VyOS REST endpoint. Args: - endpoint (str): API path, e.g. '/configure' or '/retrieve'. - Named 'endpoint' not 'path' to avoid collision - with the VyOS payload field also called 'path'. + data (str): API path, e.g. '/configure' or '/retrieve'. + Named 'data' to match the HttpApiBase signature. + Internally referred to as endpoint to avoid collision + with the VyOS payload field also called 'data'. **payload: VyOS API fields: op, path, value, url, file, etc. Returns: @@ -105,6 +105,7 @@ class HttpApi(HttpApiBase): Raises: ConnectionError: on HTTP error or VyOS success=false response. """ + endpoint = data try: api_key = self._get_api_key() |
