Skip to content

Commit

Permalink
22.7.1 released
Browse files Browse the repository at this point in the history
  • Loading branch information
SRBuilds committed Aug 3, 2022
1 parent 67aee00 commit 051b113
Show file tree
Hide file tree
Showing 19 changed files with 1,286 additions and 140 deletions.
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
author = 'Nokia'

# The full version, including alpha/beta/rc tags
version = '22.5.1'
release = '22.5.1'
version = '22.7.1'
release = '22.7.1'


# -- General configuration ---------------------------------------------------
Expand Down
55 changes: 54 additions & 1 deletion docs/source/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pySROS libraries.
pySROS data structures
######################

Having made a connection to an SR OS device, it is important to understand the data structures returned by the
Having made a connection to an SR OS device it is important to understand the data structures returned by the
:py:meth:`pysros.management.Datastore.get` function and those that can be sent to a router using
:py:meth:`pysros.management.Datastore.set`.

Expand Down Expand Up @@ -458,6 +458,59 @@ for the addition of local language personalization for developers.
.. Reviewed by TechComms 20210902
Filesystem access
#################

Filesystem access is provided to the local SR OS filesystem using the standard Python 3 methods.
Specific adaptations have been provided for some libraries. See :py:mod:`uio`, :py:mod:`uos`
and :py:mod:`uos.path` for more information.

.. note::

Filesystem access is provided using the SR OS profile of the executing user and respects
any permissions or restrictions therein.

.. important::

Python applications triggered from EHS and CRON have system access to the filesystem.

The ability to read and write to the filesystem provides many possibilities to the developer, including
the ability to maintain a persistent state between executions. This enables a developer
to choose to evaluate something based on the last time the application was run, in addition to the
instantaneous data available.

.. literalinclude:: ../../examples/filesystem_example.py
:caption: filesystem_example.py
:name: filesystem-example
:language: python
:emphasize-lines: 18-60

The example output of this application is shown below.

.. code-block:: none
[/]
A:admin@sros# pyexec filesystem_example.py
This command has been run 20 times
Number of received octets for BGP peer 5.5.5.2 (last run/this run): 205754 / 209022
The difference between the last run and this run is: 3268
[/]
A:admin@sros# pyexec filesystem_example.py
This command has been run 21 times
Number of received octets for BGP peer 5.5.5.2 (last run/this run): 209022 / 209022
The difference between the last run and this run is: 0
[/]
A:admin@sros# pyexec filesystem_example.py
This command has been run 22 times
Number of received octets for BGP peer 5.5.5.2 (last run/this run): 209022 / 209041
The difference between the last run and this run is: 19
.. Reviewed by PLM 20220630
.. Reviewed by TechComms 20220706
Further examples
################
Expand Down
6 changes: 0 additions & 6 deletions docs/source/features/22.5.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,5 @@ Release 22.5
22.5.1
######

* Introduction of new feature announcements in this documentation (backdated to release 22.2.1)

.. Reviewed by PLM 20220503
.. Reviewed by TechComms 20220503


25 changes: 25 additions & 0 deletions docs/source/features/22.7.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Release 22.7
************

22.7.1
######

* :py:meth:`pysros.management.Datastore.get` method providers filters to
limit resultant data sets.
* :py:meth:`pysros.management.Datastore.set` method provides an additional ``replace`` option
in addition to the default ``merge`` behavior.
* Local filesystem access for pySROS when executed on an SR OS device. Including provision
of adapted :py:mod:`uio`, :py:mod:`uos` and :py:mod:`uos.path` modules.
* Selectively disable SSH hostkey checking in the
:py:func:`pysros.management.connect` function.
* :py:meth:`pysros.management.Datastore.set` and and :py:meth:`pysros.management.Datastore.delete`
methods provide an option to make configuration changes in a candidate configuration without
automatically issuing a commit.
* Provision of the following new methods:

- :py:meth:`pysros.management.Datastore.lock`
- :py:meth:`pysros.management.Datastore.unlock`
- :py:meth:`pysros.management.Datastore.commit`
- :py:meth:`pysros.management.Datastore.discard`


38 changes: 22 additions & 16 deletions docs/source/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,17 @@ Glossary of terms
.. glossary::

SR OS
Nokia's Service Router Operating System
Nokia's Service Router Operating System.

YANG
Data modeling language used to define YANG models
Data modeling language used to define YANG models.

NETCONF
Network Configuration protocol
Network Configuration protocol.

.. Reviewed by PLM 20220628
.. Reviewed by TechComms 20220706
.. Reviewed by PLM 20220303
.. Reviewed by TechComms 20220503
Additional assistance
#####################
Expand All @@ -28,32 +29,37 @@ Further reading
.. seealso::

`RFC 6020 <https://www.rfc-editor.org/rfc/rfc6020.html>`_
YANG - A Data Modeling Language for the Network Configuration Protocol (NETCONF)
YANG - A Data Modeling Language for the Network Configuration Protocol (NETCONF).

`RFC 6022 <https://www.rfc-editor.org/rfc/rfc6022.html>`_
YANG Module for NETCONF Monitoring
YANG Module for NETCONF Monitoring.

`RFC 7951 <https://www.rfc-editor.org/rfc/rfc7951.html>`_
JSON Encoding of Data Modeled with YANG
JSON Encoding of Data Modeled with YANG.

`RFC 8525 <https://www.rfc-editor.org/rfc/rfc8525.html>`_
YANG Library
YANG Library.

`PEP 570 <https://peps.python.org/pep-0570>`_
Python positional-only arguments.

`Nokia Network Developer Portal <https://network.developer.nokia.com>`_
Additional resources for developing with SR OS
Additional resources for developing with SR OS.

`Nokia product documentation <https://documentation.nokia.com>`_
Product documentation
Product documentation.

.. Reviewed by PLM 20220628
.. Reviewed by TechComms 20220706
.. Reviewed by PLM 20220303
.. Reviewed by TechComms 20220503
Support and feedback
********************

* `Nokia technical support portal <https://customer.nokia.com/support/s/>`_
* `Documentation feedback <mailto:[email protected]>`_
* `Nokia technical support portal <https://customer.nokia.com/support/s/>`_.
* `Documentation feedback <mailto:[email protected]>`_.

.. Reviewed by PLM 20220303
.. Reviewed by TechComms 20220503
.. Reviewed by TechComms 20220706
8 changes: 4 additions & 4 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ documentation will be updated accordingly.
.. list-table::
:header-rows: 0

* - pySROS release: 22.5.1
* - Document Number: 3HE 18378 AAAC TQZZA
* - pySROS release: 22.7.1
* - Document Number: 3HE 18378 AAAE TQZZA

.. Reviewed by PLM 20220303
.. Reviewed by TechComms 20220503
.. Reviewed by PLM 20220621
.. Reviewed by TechComms 20220624
.. toctree::
Expand Down
28 changes: 14 additions & 14 deletions docs/source/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -471,19 +471,19 @@ Example:
def get_connection():
try:
c = connect(host="192.168.74.51",
username="admin",
password="admin")
connection_object = connect(host="192.168.74.51",
username="admin",
password="admin")
except RuntimeError as e1:
print("Failed to connect. Error:", e1)
sys.exit(-1)
except ModelProcessingError as e2:
print("Failed to create model-driven schema. Error:", e2)
sys.exit(-2)
return c
return connection_object
if __name__ == "__main__":
c = get_connection()
connection_object = get_connection()
.. Reviewed by PLM 20210902
Expand Down Expand Up @@ -512,8 +512,8 @@ Example:
:name: get-example
>>> from pysros.management import connect
>>> c = connect()
>>> c.running.get('/nokia-conf:configure/router[router-name="Base"]/bgp')
>>> connection_object = connect()
>>> connection_object.running.get('/nokia-conf:configure/router[router-name="Base"]/bgp')
Container({'group': {'mesh': Container({'group-name': Leaf('mesh'), 'admin-state': Leaf('enable'),
'peer-as': Leaf(65535)})}, 'neighbor': {'5.5.5.2': Container({'group': Leaf('mesh'),
'import': Container({'policy': LeafList(['demo', 'example-policy-statement'])}),
Expand Down Expand Up @@ -565,12 +565,12 @@ To configure the SR OS device, use the :py:meth:`pysros.management.Datastore.set
from pysros.management import connect, Empty
from pysros.wrappers import Leaf, Container
c = connect()
connection_object = connect()
path = '/nokia-conf:configure/system/grpc'
payload = Container({'allow-unsecure-connection': Leaf(Empty),
'admin-state': Leaf('enable'),
'gnmi': Container({'admin-state': Leaf('enable')})})
c.candidate.set(path, payload)
connection_object.candidate.set(path, payload)
The :py:meth:`pysros.management.Datastore.set` method creates a private candidate configuration on the SR OS device,
makes the required configuration changes, validates the changes, performs an update of the baseline configuration
Expand All @@ -586,10 +586,10 @@ Objects obtained using :py:meth:`pysros.management.Datastore.get` may be returne
from pysros.management import connect, Empty
from pysros.wrappers import Leaf, Container
c = connect()
connection_object = connect()
path = '/nokia-conf:configure/system/grpc'
payload = c.running.get(path)
c.candidate.set(path, payload)
payload = connection_object.running.get(path)
connection_object.candidate.set(path, payload)
The :py:meth:`pysros.management.Datastore.set` method also accepts payloads that do not include the pySROS wrapper information.
Expand All @@ -601,10 +601,10 @@ This enables the developer to simply structure their own data.
from pysros.management import connect, Empty
from pysros.wrappers import Leaf, Container
c = connect()
connection_object = connect()
path = '/nokia-conf:configure/system/grpc'
payload = {'allow-unsecure-connection': Empty, 'admin-state': 'enable', 'gnmi': {'admin-state': 'enable'}}
c.candidate.set(path, payload)
connection_object.candidate.set(path, payload)
.. Reviewed by PLM 20210902
Expand Down
14 changes: 10 additions & 4 deletions docs/source/modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,24 @@ pySROS modules

pysros


Libraries specific to SR OS
Libraries adapted for SR OS
===========================

The adapted versions of the modules documented here, are provided when
The adapted versions of the modules documented here are provided when
executing on SR OS only. When executing on a remote device, the native
Python versions of the library are used.

.. Reviewed by PLM 20220628
.. Reviewed by TechComms 20220706
.. toctree::
:maxdepth: 6

utime
uio
uos
uos.path


.. Reviewed by PLM 20220628
.. Reviewed by TechComms 20220706
Loading

0 comments on commit 051b113

Please sign in to comment.