CRUD Service
YDK CrudService class provides API for Create/Read/Update/Delete operations on device configuration.
All CRUD operations performed on entities, where Entity instance represents single container in one of the device supported models.
- class ydk.services.CRUDService
Supports CRUD operations on model API entities.
- create(provider, entities)
Create one or more entities in device configuration.
- Parameters
- Returns
True, if configuration created successfully;Falseotherwise.- Raises
Exception
YServiceProviderError, if an error has occurred.
- read(provider, filter)
Read one or more entities from device (configuration and state).
- Parameters
- Returns
For single entity filter - an instance of
Entityas identified by the filter orNone, if operation fails.For multiple filters - collection of
Entityinstances encapsulated into PythonlistorConfigaccordingly to the type of filter.- Raises
Exception
YServiceProviderError, if an error has occurred.
- read_config(provider, filter)
Read one or more entities from device running configuration.
- Parameters
- Returns
For single entity filter - an instance of
Entityas identified by the filter orNone, if operation fails.For multiple filters - collection of
Entityinstances encapsulated into PythonlistorConfigaccordingly to the type of filter.- Raises
Exception
YServiceProviderError, if an error has occurred.
- update(provider, entities)
Update one or more entities in device configuration.
- Parameters
- Returns
Trueif successful,False- otherwise.- Raises
Exception
YServiceProviderError, if an error has occurred.
- delete(provider, entities)
Delete one or more entities in device configuration.
- Parameters
- Returns
Trueif successful,False- otherwise.- Raises
Exception
YServiceProviderError, if an error has occurred.