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;False
otherwise.- 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
Entity
as identified by the filter orNone
, if operation fails.For multiple filters - collection of
Entity
instances encapsulated into Pythonlist
orConfig
accordingly 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
Entity
as identified by the filter orNone
, if operation fails.For multiple filters - collection of
Entity
instances encapsulated into Pythonlist
orConfig
accordingly 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:
True
if successful,False
- otherwise.- Raises:
Exception
YServiceProviderError
, if an error has occurred.
- delete(provider, entities)
Delete one or more entities in device configuration.
- Parameters:
- Returns:
True
if successful,False
- otherwise.- Raises:
Exception
YServiceProviderError
, if an error has occurred.