Skip to content

Commit

Permalink
Merge branch 'master' of github.com:vyos/vyos-documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
rebortg committed Jan 14, 2024
2 parents 0740593 + ad280ba commit 14c94be
Show file tree
Hide file tree
Showing 61 changed files with 3,766 additions and 2,089 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ venv/
ENV/
.venv
Pipfile.lock
Pipfile

# put various editor ignores here
.vscode/
Expand Down
2 changes: 1 addition & 1 deletion docs/_include/vyos-1x
Submodule vyos-1x updated 611 files
4 changes: 2 additions & 2 deletions docs/_locale/de/configuration.pot
Original file line number Diff line number Diff line change
Expand Up @@ -19468,8 +19468,8 @@ msgid "``latency``: A server profile focused on lowering network latency. This p
msgstr "``latency``: A server profile focused on lowering network latency. This profile favors performance over power savings by setting ``intel_pstate`` and ``min_perf_pct=100``."

#: ../../configuration/loadbalancing/reverse-proxy.rst:108
msgid "``least-connection`` Distributes requests tp tje server wotj the fewest active connections"
msgstr "``least-connection`` Distributes requests tp tje server wotj the fewest active connections"
msgid "``least-connection`` Distributes requests to the server with the fewest active connections"
msgstr "``least-connection`` Distributes requests to the server with the fewest active connections"

#: ../../configuration/vpn/ipsec.rst:125
msgid "``life-bytes`` ESP life in bytes <1024-26843545600000>. Number of bytes transmitted over an IPsec SA before it expires;"
Expand Down
2 changes: 1 addition & 1 deletion docs/_locale/es/configuration.pot
Original file line number Diff line number Diff line change
Expand Up @@ -19468,7 +19468,7 @@ msgid "``latency``: A server profile focused on lowering network latency. This p
msgstr "``latency``: un perfil de servidor centrado en reducir la latencia de la red. Este perfil favorece el rendimiento sobre el ahorro de energía configurando ``intel_pstate`` y ``min_perf_pct=100``."

#: ../../configuration/loadbalancing/reverse-proxy.rst:108
msgid "``least-connection`` Distributes requests tp tje server wotj the fewest active connections"
msgid "``least-connection`` Distributes requests to the server with the fewest active connections"
msgstr "``least-connection`` Distribuye las solicitudes al servidor con la menor cantidad de conexiones activas"

#: ../../configuration/vpn/ipsec.rst:125
Expand Down
4 changes: 2 additions & 2 deletions docs/_locale/ja/configuration.pot
Original file line number Diff line number Diff line change
Expand Up @@ -19468,8 +19468,8 @@ msgid "``latency``: A server profile focused on lowering network latency. This p
msgstr "``latency``: A server profile focused on lowering network latency. This profile favors performance over power savings by setting ``intel_pstate`` and ``min_perf_pct=100``."

#: ../../configuration/loadbalancing/reverse-proxy.rst:108
msgid "``least-connection`` Distributes requests tp tje server wotj the fewest active connections"
msgstr "``least-connection`` Distributes requests tp tje server wotj the fewest active connections"
msgid "``least-connection`` Distributes requests to the server with the fewest active connections"
msgstr "``least-connection`` Distributes requests to the server with the fewest active connections"

#: ../../configuration/vpn/ipsec.rst:125
msgid "``life-bytes`` ESP life in bytes <1024-26843545600000>. Number of bytes transmitted over an IPsec SA before it expires;"
Expand Down
4 changes: 2 additions & 2 deletions docs/_locale/pt/configuration.pot
Original file line number Diff line number Diff line change
Expand Up @@ -19468,8 +19468,8 @@ msgid "``latency``: A server profile focused on lowering network latency. This p
msgstr "``latency``: A server profile focused on lowering network latency. This profile favors performance over power savings by setting ``intel_pstate`` and ``min_perf_pct=100``."

#: ../../configuration/loadbalancing/reverse-proxy.rst:108
msgid "``least-connection`` Distributes requests tp tje server wotj the fewest active connections"
msgstr "``least-connection`` Distributes requests tp tje server wotj the fewest active connections"
msgid "``least-connection`` Distributes requests to the server with the fewest active connections"
msgstr "``least-connection`` Distributes requests to the server with the fewest active connections"

#: ../../configuration/vpn/ipsec.rst:125
msgid "``life-bytes`` ESP life in bytes <1024-26843545600000>. Number of bytes transmitted over an IPsec SA before it expires;"
Expand Down
4 changes: 2 additions & 2 deletions docs/_locale/uk/configuration.pot
Original file line number Diff line number Diff line change
Expand Up @@ -19468,8 +19468,8 @@ msgid "``latency``: A server profile focused on lowering network latency. This p
msgstr "``latency``: A server profile focused on lowering network latency. This profile favors performance over power savings by setting ``intel_pstate`` and ``min_perf_pct=100``."

#: ../../configuration/loadbalancing/reverse-proxy.rst:108
msgid "``least-connection`` Distributes requests tp tje server wotj the fewest active connections"
msgstr "``least-connection`` Distributes requests tp tje server wotj the fewest active connections"
msgid "``least-connection`` Distributes requests to the server with the fewest active connections"
msgstr "``least-connection`` Distributes requests to the server with the fewest active connections"

#: ../../configuration/vpn/ipsec.rst:125
msgid "``life-bytes`` ESP life in bytes <1024-26843545600000>. Number of bytes transmitted over an IPsec SA before it expires;"
Expand Down
Binary file modified docs/_static/images/firewall-bridge-packet-flow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_static/images/firewall-gral-packet-flow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions docs/automation/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ VyOS Automation
vyos-salt
command-scripting
cloud-init
vyos-pyvyos

148 changes: 148 additions & 0 deletions docs/automation/vyos-pyvyos.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
:lastproofread: 2023-12-15

.. _vyos-pyvyos:

PyVyOS
======

PyVyOS is a Python library for interacting with VyOS devices via their API.
This documentation guides you on using PyVyOS to manage your VyOS devices programmatically.
The complete PyVyOS documentation is available on [Read the Docs](https://pyvyos.readthedocs.io/en/latest/),
and the library can be found on [GitHub](https://github.com/robertoberto/pyvyos)
and [PyPI](https://pypi.org/project/pyvyos/).

Installation
------------

You can install PyVyOS using pip:

.. code-block:: bash

pip install pyvyos

Getting Started
---------------

Importing and Disabling Warnings for verify=False
-------------------------------------------------

.. code-block:: none

import urllib3
urllib3.disable_warnings()

Using API Response Class
------------------------

.. code-block:: none

@dataclass
class ApiResponse:
status: int
request: dict
result: dict
error: str

Initializing a VyDevice Object
------------------------------

.. code-block:: none

from dotenv import load_dotenv
load_dotenv()

hostname = os.getenv('VYDEVICE_HOSTNAME')
apikey = os.getenv('VYDEVICE_APIKEY')
port = os.getenv('VYDEVICE_PORT')
protocol = os.getenv('VYDEVICE_PROTOCOL')
verify_ssl = os.getenv('VYDEVICE_VERIFY_SSL')

verify = verify_ssl.lower() == "true" if verify_ssl else True

device = VyDevice(hostname=hostname, apikey=apikey, port=port, protocol=protocol, verify=verify)

Using PyVyOS
------------

Configure, then Set
^^^^^^^^^^^^^^^^^^^^^^^^

.. code-block:: none

response = device.configure_set(path=["interfaces", "ethernet", "eth0", "address", "192.168.1.1/24"])
if not response.error:
print(response.result)

Configure, then Show a Single Object Value
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. code-block:: none

response = device.retrieve_return_values(path=["interfaces", "dummy", "dum1", "address"])
print(response.result)

Configure, then Show Object
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. code-block:: none

response = device.retrieve_show_config(path=[])
if not response.error:
print(response.result)

Configure, then Delete Object
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. code-block:: none

response = device.configure_delete(path=["interfaces", "dummy", "dum1"])

Configure, then Save
^^^^^^^^^^^^^^^^^^^^^^^^

.. code-block:: none

response = device.config_file_save()

Configure, then Save File
-------------------------

.. code-block:: none

response = device.config_file_save(file="/config/test300.config")

Show Object
^^^^^^^^^^^^^^

.. code-block:: none

response = device.show(path=["system", "image"])
print(response.result)

Generate Object
^^^^^^^^^^^^^^^^

.. code-block:: none

randstring = ''.join(random.choice(string.ascii_letters + string.digits) for _ in range(20))
keyrand = f'/tmp/key_{randstring}'
response = device.generate(path=["ssh", "client-key", keyrand])

Reset Object
^^^^^^^^^^^^^^

.. code-block:: none

response = device.reset(path=["conntrack-sync", "internal-cache"])
if not response.error:
print(response.result)

Configure, then Load File
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. code-block:: none

response = device.config_file_load(file="/config/test300.config")


.. _pyvyos: https://github.com/robertoberto/pyvyos
65 changes: 65 additions & 0 deletions docs/changelog/1.3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,71 @@
_ext/releasenotes.py


2023-12-29
==========

* :vytask:`T5852` ``(bug): Reboots fail with eapol WAN interface``


2023-12-22
==========

* :vytask:`T4760` ``(bug): VyOS does not support running multiple instances of DHCPv6 clients``


2023-12-21
==========

* :vytask:`T5714` ``(bug): IPSec VPN: op-mode: "show log vpn" does not show results``
* :vytask:`T3039` ``(feature): Resize a root partition and filesystem automatically during deployment in virtual environments``
* :vytask:`T2404` ``(bug): Cannot change MTU``
* :vytask:`T2353` ``(bug): Interface [conf_mode] errors parent task``
* :vytask:`T5796` ``(bug): Openconnect - HTTPS security headers are missing``


2023-12-19
==========

* :vytask:`T2116` ``(feature): Processing configuration via Cloud-init User-Data``


2023-12-18
==========

* :vytask:`T2191` ``(feature): Using tallow to block sshd probes``


2023-12-15
==========

* :vytask:`T5824` ``(bug): busybox cannot connect some websites from initramfs``


2023-12-12
==========

* :vytask:`T5817` ``(bug): Show openvpn server fails in some cases``
* :vytask:`T5413` ``(default): Deny the opportunity to use one public/private key pair on both wireguard peers.``


2023-11-30
==========

* :vytask:`T4601` ``(bug): dhcp : relay agent IP address issue.``


2023-11-28
==========

* :vytask:`T5777` ``(bug): frr: backport and upstream recent bgpd daemon crashes``


2023-11-27
==========

* :vytask:`T5763` ``(bug): Fix imprecise check for remote file name in vyos-load-config.py``


2023-11-25
==========

Expand Down
Loading

0 comments on commit 14c94be

Please sign in to comment.