Skip to content

Commit

Permalink
YPYError->YError (#748)
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhi Keshav authored Apr 11, 2018
1 parent 74457e8 commit 4b57c83
Show file tree
Hide file tree
Showing 37 changed files with 275 additions and 275 deletions.
32 changes: 16 additions & 16 deletions sdk/python/core/docsgen/api/errors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,51 +6,51 @@ Errors

This module contains YDK Python errors classes. These errors are thrown in case of data not conforming to the yang model or due to a server-side error.

.. py:exception:: YPYError
.. py:exception:: YError
Bases: :exc:`exceptions.Exception`

Base class for YPY Errors. The subclasses give a specialized view of the error that has occurred.
Base class for Y Errors. The subclasses give a specialized view of the error that has occurred.

.. py:exception:: YPYModelError
.. py:exception:: YModelError
Bases: :exc:`ydk.errors.YPYError`
Bases: :exc:`ydk.errors.YError`

Model Error. Thrown when a model constraint is violated.

.. py:exception:: YPYServiceProviderError
.. py:exception:: YServiceProviderError
Bases: :exc:`ydk.errors.YPYError`
Bases: :exc:`ydk.errors.YError`

Exception for Service Provider. Thrown in case of a server-side error.

.. py:exception:: YPYClientError
.. py:exception:: YClientError
Bases: :exc:`ydk.errors.YPYError`
Bases: :exc:`ydk.errors.YError`

Exception for client connection

.. py:exception:: YPYIllegalStateError
.. py:exception:: YIllegalStateError
Bases: :exc:`ydk.errors.YPYError`
Bases: :exc:`ydk.errors.YError`

Illegal State Error. Thrown when an operation/service is invoked on an object that is not in the right state. Use the error_msg for the error.

.. py:exception:: YPYInvalidArgumentError
.. py:exception:: YInvalidArgumentError
Bases: :exc:`ydk.errors.YPYError`
Bases: :exc:`ydk.errors.YError`

Invalid Argument. Use the error_msg for the error.

.. py:exception:: YPYOperationNotSupportedError
.. py:exception:: YOperationNotSupportedError
Bases: :exc:`ydk.errors.YPYError`
Bases: :exc:`ydk.errors.YError`

Operation Not Supported Error. Thrown when an operation is not supported.

.. py:exception:: YPYServiceError
.. py:exception:: YServiceError
Bases: :exc:`ydk.errors.YPYError`
Bases: :exc:`ydk.errors.YError`

Exception for Service Side Validation

Expand Down
4 changes: 2 additions & 2 deletions sdk/python/core/docsgen/api/filters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Filters
containing this attribute is added to the configuration if
and only if the configuration data does not already exist in
the configuration datastore. If the configuration data
exists, an :class:`ydk.errors.YPYServiceProviderError` will be thrown
exists, an :class:`ydk.errors.YServiceProviderError` will be thrown
with XML error message.

.. attribute:: delete
Expand All @@ -22,7 +22,7 @@ Filters
containing this attribute is deleted from the configuration
if and only if the configuration data currently exists in
the configuration datastore. If the configuration data does
not exist, an :class:`ydk.errors.YPYServiceProviderError` will be
not exist, an :class:`ydk.errors.YServiceProviderError` will be
thrown with XML error message.

.. attribute:: merge
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/core/docsgen/api/providers/odl_provider.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Opendaylight Service Provider

:param node_id: (``str``) The name of the device being controlled by the OpenDaylight instance.
:return: One of supported service provider instance.
:raises: :py:exc:`YPYError<ydk.errors.YPYServiceProviderError>` if no such service provider could be found.
:raises: :py:exc:`YError<ydk.errors.YServiceProviderError>` if no such service provider could be found.

.. py:method:: get_node_ids()
Expand Down
4 changes: 2 additions & 2 deletions sdk/python/core/docsgen/api/services/codec_service.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ YDK CodecService class provides API for encoding and decoding of payload strings
:param pretty: ``bool`` flag, which specifies if resulting string must be in human readable way with indentation.
:param subtree: ``bool`` flag, which directs to encode entity to XML subtree.
:return: Type of returned object corresponds to the type of **entity**: single payload ``str``, or ``list`` of ``str``, or a ``dictionary`` of ``str``.
:raises: :py:exc:`YPYError<ydk.errors.YPYError>`, if error has occurred.
:raises: :py:exc:`YError<ydk.errors.YError>`, if error has occurred.

.. py:method:: decode(provider, payload, subtree=False)
Expand All @@ -25,4 +25,4 @@ YDK CodecService class provides API for encoding and decoding of payload strings
:param payload: ``str`` or collection of ``str`` Either a single encoded payload or a collection of payloads encapsulated to ``list`` or ``dict``.
:param subtree: ``bool`` flag, which directs to encode entity to XML subtree.
:return: Type of returned object corresponds to the type of **payload**. It is either an instance of :py:class:`Entity<ydk.types.Entity>`, or a collection of :py:class:`Entity<ydk.types.Entity>` instances of type ``list`` or ``dict``.
:raises: :py:exc:`YPYError<ydk.errors.YPYError>`, if error has occurred.
:raises: :py:exc:`YError<ydk.errors.YError>`, if error has occurred.
10 changes: 5 additions & 5 deletions sdk/python/core/docsgen/api/services/crud_service.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ All CRUD operations performed on entities, where :py:class:`Entity<ydk.types.Ent

For multiple entities encapsulate :py:class:`Entity<ydk.types.Entity>` instances in Python ``list`` or :py:class:`Config<ydk.types.Config>`.
:return: ``True``, if configuration created successfully; ``False`` otherwise.
:raises: Exception :py:exc:`YPYError<ydk.errors.YPYError>`, if an error has occurred.
:raises: Exception :py:exc:`YError<ydk.errors.YError>`, if an error has occurred.

.. py:method:: read(provider, filter)
Expand All @@ -30,7 +30,7 @@ All CRUD operations performed on entities, where :py:class:`Entity<ydk.types.Ent
:return: For single entity filter - an instance of :py:class:`Entity<ydk.types.Entity>` as identified by the **filter** or ``None``, if operation fails.

For multiple filters - collection of :py:class:`Entity<ydk.types.Entity>` instances encapsulated into Python ``list`` or :py:class:`Config<ydk.types.Config>` accordingly to the type of **filter**.
:raises: Exception :py:exc:`YPYError<ydk.errors.YPYError>`, if an error has occurred.
:raises: Exception :py:exc:`YError<ydk.errors.YError>`, if an error has occurred.

.. py:method:: read_config(provider, filter)
Expand All @@ -43,7 +43,7 @@ All CRUD operations performed on entities, where :py:class:`Entity<ydk.types.Ent
:return: For single entity filter - an instance of :py:class:`Entity<ydk.types.Entity>` as identified by the **filter** or ``None``, if operation fails.

For multiple filters - collection of :py:class:`Entity<ydk.types.Entity>` instances encapsulated into Python ``list`` or :py:class:`Config<ydk.types.Config>` accordingly to the type of **filter**.
:raises: Exception :py:exc:`YPYError<ydk.errors.YPYError>`, if an error has occurred.
:raises: Exception :py:exc:`YError<ydk.errors.YError>`, if an error has occurred.

.. py:method:: update(provider, entities)
Expand All @@ -54,7 +54,7 @@ All CRUD operations performed on entities, where :py:class:`Entity<ydk.types.Ent

For multiple containers encapsulate :py:class:`Entity<ydk.types.Entity>` instances in Python ``list`` or :py:class:`Config<ydk.types.Config>`.
:return: ``True`` if successful, ``False`` - otherwise.
:raises: Exception :py:exc:`YPYError<ydk.errors.YPYError>`, if an error has occurred.
:raises: Exception :py:exc:`YError<ydk.errors.YError>`, if an error has occurred.

.. py:method:: delete(provider, entities)
Expand All @@ -65,4 +65,4 @@ All CRUD operations performed on entities, where :py:class:`Entity<ydk.types.Ent

For multiple containers encapsulate :py:class:`Entity<ydk.types.Entity>` instances in Python ``list`` or :py:class:`Config<ydk.types.Config>`.
:return: ``True`` if successful, ``False`` - otherwise.
:raises: Exception :py:exc:`YPYError<ydk.errors.YPYError>`, if an error has occurred.
:raises: Exception :py:exc:`YError<ydk.errors.YError>`, if an error has occurred.
2 changes: 1 addition & 1 deletion sdk/python/core/docsgen/api/services/executor_service.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Executor Service
:param top_entity: (:py:class:`Entity<ydk.types.Entity>` optional) Provide an instance of :py:class:`Entity<ydk.types.Entity>` only when expecting data to be returned.

:return: An instance of :py:class:`Entity<ydk.types.Entity>` when provided top_entity or None otherwise
:raises: :py:exc:`YPYError<ydk.errors.YPYError>` if an error has occurred.
:raises: :py:exc:`YError<ydk.errors.YError>` if an error has occurred.

Possible Errors:

Expand Down
26 changes: 13 additions & 13 deletions sdk/python/core/docsgen/api/services/netconf_service.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ All NetconfService operations performed on :py:class:`Datastore<ydk.ext.services
:param provider: :py:class:`NetconfServiceProvider<ydk.providers.NetconfServiceProvider>` instance.
:param persist_id: An ``int`` that cancels a persistent confirmed commit.
:return: ``True`` if the operation succeeds, ``False`` - otherwise.
:raises: :py:exc:`YPYError<ydk.errors.YPYError>`, if error has occurred.
:raises: :py:exc:`YError<ydk.errors.YError>`, if error has occurred.

.. py:method:: close_session(provider)
Request graceful termination of a NETCONF session.

:param provider: :py:class:`NetconfServiceProvider<ydk.providers.NetconfServiceProvider>` instance.
:return: ``True`` if the operation succeeds, ``False`` - otherwise.
:raises: :py:exc:`YPYError<ydk.errors.YPYError>`, if error has occurred.
:raises: :py:exc:`YError<ydk.errors.YError>`, if error has occurred.

.. py:method:: commit(provider, confirmed=False, confirm_timeout=None, persist=None, persist_id=None)
Expand All @@ -44,7 +44,7 @@ All NetconfService operations performed on :py:class:`Datastore<ydk.ext.services
:param persist: An ``int`` that makes the confirmed commit persistent.
:param persist_id: An ``int`` that is given in order to commit a persistent confirmed commit.
:return: ``True`` if the operation succeeds, ``False`` - otherwise.
:raises: :py:exc:`YPYError<ydk.errors.YPYError>`, if error has occurred.
:raises: :py:exc:`YError<ydk.errors.YError>`, if error has occurred.

.. py:method:: copy_config(provider, target, source=None, url='', source-config=None)
Expand All @@ -58,7 +58,7 @@ All NetconfService operations performed on :py:class:`Datastore<ydk.ext.services

For multiple containers the :py:class:`Entity<ydk.types.Entity>` instances must be encapsulate in Python ``list`` or :py:class:`Config<ydk.types.Config>`.
:return: ``True`` if the operation succeeds, ``False`` - otherwise.
:raises: :py:exc:`YPYError<ydk.errors.YPYError>`, if error has occurred.
:raises: :py:exc:`YError<ydk.errors.YError>`, if error has occurred.

.. py:method:: delete_config(provider, target, url="")
Expand All @@ -68,15 +68,15 @@ All NetconfService operations performed on :py:class:`Datastore<ydk.ext.services
:param target: An instance of :py:class:`Datastore<ydk.ext.services.Datastore>` representing configuration to be deleted.
:param url: A ``str`` representing the configuration URL. Optional parameter required only when target is set to ``url``.
:return: ``True`` if the operation succeeds, ``False`` - otherwise.
:raises: :py:exc:`YPYError<ydk.errors.YPYError>`, if error has occurred.
:raises: :py:exc:`YError<ydk.errors.YError>`, if error has occurred.

.. py:method:: discard_changes(provider)
Used to revert the candidate configuration to the current running configuration.

:param provider: :py:class:`NetconfServiceProvider<ydk.providers.NetconfServiceProvider>` instance.
:return: ``True`` if the operation succeeds, ``False`` - otherwise.
:raises: :py:exc:`YPYError<ydk.errors.YPYError>`, if error has occurred.
:raises: :py:exc:`YError<ydk.errors.YError>`, if error has occurred.

.. py:method:: edit_config(provider, target, config, default_operation='', error_option='', test_option='')
Expand All @@ -91,7 +91,7 @@ All NetconfService operations performed on :py:class:`Datastore<ydk.ext.services
:param error_option: A ``str`` that can be set to ``test-then-set``, ``set``, or ``test-only`` if the device advertises the :validate:1.1 capability; this parameter is optional.
:param test_option: A ``str`` that can be set to ``stop-on-error``, ``continue-on-error``, or ``rollback-on-error``; this parameter is optional.
:return: ``True`` if the operation succeeds, ``False`` - otherwise.
:raises: :py:exc:`YPYError<ydk.errors.YPYError>`, if error has occurred.
:raises: :py:exc:`YError<ydk.errors.YError>`, if error has occurred.

.. py:method:: get_config(provider, source, filter)
Expand All @@ -105,7 +105,7 @@ All NetconfService operations performed on :py:class:`Datastore<ydk.ext.services
:return: For single entity filter - an instance of :py:class:`Entity<ydk.types.Entity>` as identified by the **filter** or ``None``, if operation fails.

For multiple filters - collection of :py:class:`Entity<ydk.types.Entity>` instances encapsulated into Python ``list`` or :py:class:`Config<ydk.types.Config>` accordingly to the type of **filter**.
:raises: :py:exc:`YPYError<ydk.errors.YPYError>`, if error has occurred.
:raises: :py:exc:`YError<ydk.errors.YError>`, if error has occurred.

.. py:method:: get(provider, filter)
Expand All @@ -118,7 +118,7 @@ All NetconfService operations performed on :py:class:`Datastore<ydk.ext.services
:return: For single entity filter - an instance of :py:class:`Entity<ydk.types.Entity>` as identified by the **filter** or ``None``, if operation fails.

For multiple filters - collection of :py:class:`Entity<ydk.types.Entity>` instances encapsulated into Python ``list`` or :py:class:`Config<ydk.types.Config>` accordingly to the type of **filter**.
:raises: :py:exc:`YPYError<ydk.errors.YPYError>`, if error has occurred.
:raises: :py:exc:`YError<ydk.errors.YError>`, if error has occurred.

.. py:method:: kill_session(provider, session_id)
Expand All @@ -127,7 +127,7 @@ All NetconfService operations performed on :py:class:`Datastore<ydk.ext.services
:param provider: :py:class:`NetconfServiceProvider<ydk.providers.NetconfServiceProvider>` instance.
:param session_id: An ``int`` - session identifier of the NETCONF session to be terminated.
:return: ``True`` if the operation succeeds, ``False`` - otherwise.
:raises: :py:exc:`YPYError<ydk.errors.YPYError>`, if error has occurred.
:raises: :py:exc:`YError<ydk.errors.YError>`, if error has occurred.

.. py:method:: lock(provider, target)
Expand All @@ -136,7 +136,7 @@ All NetconfService operations performed on :py:class:`Datastore<ydk.ext.services
:param provider: :py:class:`NetconfServiceProvider<ydk.providers.NetconfServiceProvider>` instance.
:param target: An instance of :py:class:`Datastore<ydk.ext.services.Datastore>` representing the configuration to lock.
:return: ``True`` if the operation succeeds, ``False`` - otherwise.
:raises: :py:exc:`YPYError<ydk.errors.YPYError>`, if error has occurred.
:raises: :py:exc:`YError<ydk.errors.YError>`, if error has occurred.

.. py:method:: unlock(provider, target)
Expand All @@ -145,7 +145,7 @@ All NetconfService operations performed on :py:class:`Datastore<ydk.ext.services
:param provider: :py:class:`NetconfServiceProvider<ydk.providers.NetconfServiceProvider>` instance.
:param target: An instance of :py:class:`Datastore<ydk.ext.services.Datastore>` representing the configuration to unlock.
:return: ``True`` if the operation succeeds, ``False`` - otherwise.
:raises: :py:exc:`YPYError<ydk.errors.YPYError>`, if error has occurred.
:raises: :py:exc:`YError<ydk.errors.YError>`, if error has occurred.

.. py:method:: validate(provider, source=None, url='', source_config=None)
Expand All @@ -156,4 +156,4 @@ All NetconfService operations performed on :py:class:`Datastore<ydk.ext.services
:param url: A ``str`` representing the configuration **url**.
:param source_config: :py:class:`Entity<ydk.types.Entity>` An instance of :py:class:`Entity<ydk.types.Entity>` representing the configuration to validate.
:return: ``True`` if the operation succeeds, ``False`` - otherwise.
:raises: :py:exc:`YPYError<ydk.errors.YPYError>`, if error has occurred.
:raises: :py:exc:`YError<ydk.errors.YError>`, if error has occurred.
8 changes: 4 additions & 4 deletions sdk/python/core/docsgen/api/types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,14 @@ YDK types
Create **EntityCollection** instance:

:param entities: If not present or ``None``, creates empty collection. Otherwise the instances of :py:class:`Entity<ydk.types.Entity>` class should be listed as parameters.
:raises: Exception :py:exc:`YPYInvalidArgumentError<ydk.error.YPYInvalidArgumentError>`, if type of **entities** is different.
:raises: Exception :py:exc:`YInvalidArgumentError<ydk.error.YInvalidArgumentError>`, if type of **entities** is different.

.. py:method:: append(entities):
Add entity or multiple entities to collection.

:param entities: Instance of an :py:class:`Entity<ydk.types.Entity>` or Python ``list`` of :py:class:`Entity<ydk.types.Entity>` instances.
:raises: Exception :py:exc:`YPYInvalidArgumentError<ydk.error.YPYInvalidArgumentError>`, if type of **entities** is different.
:raises: Exception :py:exc:`YInvalidArgumentError<ydk.error.YInvalidArgumentError>`, if type of **entities** is different.

Example usage for creating **EntityCollection**:

Expand Down Expand Up @@ -164,7 +164,7 @@ YDK types

If **item** type is ``Entity``, the operator returns :py:class:`Entity<ydk.types.Entity>` instance, which has matching key (entity.path()==item.path()).
:return: Instance of :py:class:`Entity<ydk.types.Entity>` or ``None``, if matching instance is not in the collection.
:raises: Exception :py:exc:`YPYInvalidArgumentError<ydk.error.YPYInvalidArgumentError>`, if type of **item** is other than ``int`` or ``str`` or ``Entity``.
:raises: Exception :py:exc:`YInvalidArgumentError<ydk.error.YInvalidArgumentError>`, if type of **item** is other than ``int`` or ``str`` or ``Entity``.

Examples for accessing **EntityCollection** members:

Expand Down Expand Up @@ -215,7 +215,7 @@ YDK types

If **item** type is ``Entity``, finds and deletes collection member, which has matching key.
:return: :py:class:`Entity<ydk.types.Entity>` instance of deleted member of collection, or ``None``, if matching instance is not found in collection.
:raises: Exception :py:exc:`YPYInvalidArgumentError<ydk.error.YPYInvalidArgumentError>`, if type of **item** is other than ``int`` or ``str`` or ``Entity``.
:raises: Exception :py:exc:`YInvalidArgumentError<ydk.error.YInvalidArgumentError>`, if type of **item** is other than ``int`` or ``str`` or ``Entity``.

Examples of deleting items in the collection:

Expand Down
2 changes: 1 addition & 1 deletion sdk/python/core/docsgen/guides/deviation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ The above app results in the below errors logged and exception being raised beca
File "/Users/lib/python3.6/site-packages/ydk/errors/error_handler.py", line 54, in _raise
exec("raise exc from None")
File "<string>", line 1, in <module>
ydk.errors.YPYModelError: Invalid path: subscription[subscription-id='123'] : Schema node not found.. Path: subscription
ydk.errors.YModelError: Invalid path: subscription[subscription-id='123'] : Schema node not found.. Path: subscription
4 changes: 2 additions & 2 deletions sdk/python/core/docsgen/guides/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ service provider instance and our entity (``bgp_cfg``):
try:
crud_service.create(sp_instance, bgp_cfg)
except YPYError:
except YError:
Note if there were any errors the above API will raise a YPYError exception.
Note if there were any errors the above API will raise a YError exception.

.. _howto-logging:

Expand Down
Loading

0 comments on commit 4b57c83

Please sign in to comment.