CRUD Service¶
-
class
ydk::CrudService¶ CRUD Service class for supporting CRUD operations on entities.
-
CrudService()¶
-
bool
create(ydk::ServiceProvider &provider, Entity &entity)¶ Create the entity.
Parameters: - provider – An instance of
ServiceProvider. - entity – An instance of
Entityclass defined under a bundle.
Returns: true, if successful, false - otherwise.
Raises: YError, if an error has occurred.
- provider – An instance of
-
bool
create(ydk::ServiceProvider &provider, std::vector<Entity *> &entities)¶ Create multiple entities.
Parameters: - provider – An instance of
ServiceProvider. - entities – An instance of std::vector<Entity*> class, which contains one or more entities.
Returns: true, if successful, false - otherwise.
Raises: YError, if an error has occurred.
- provider – An instance of
-
std::shared_ptr<ydk::Entity>
read(ydk::ServiceProvider &provider, Entity &filter)¶ Read configuration and state data for specified filter.
Parameters: - provider – An instance of
ServiceProvider. - filter – An instance of
entityclass defined under a bundle.
Returns: A pointer to an instance of
Entityas identified by the filter if successful,nullptr- otherwise.Raises: YError, if an error has occurred.
- provider – An instance of
-
std::vector<std::shared_ptr<Entity>>
read(ydk::ServiceProvider &provider, std::vector<Entity *> &filters)¶ Read configuration and state data for specified filter.
Parameters: - provider – An instance of
ServiceProvider. - filter – An instance of std::vector<Entity*> class, which contains one or more entities defined under a bundle.
Returns: An instance of std::vector<std::shared_ptr<Entity>> as identified by the filters if successful, instance of empty std::vector - otherwise.
Raises: YError, if an error has occurred.
- provider – An instance of
-
std::shared_ptr<ydk::Entity>
read_config(ydk::ServiceProvider &provider, Entity &filter)¶ Read only configuration data for specified filter.
Parameters: - provider – An instance of
ServiceProvider. - filter – An instance of
entityclass defined under a bundle.
Returns: A pointer to an instance of
Entityas identified by the filter if successful,nullptr- otherwise.Raises: YError, if an error has occurred.
- provider – An instance of
-
std::vector<std::shared_ptr<Entity>>
read_config(ydk::ServiceProvider &provider, std::vector<Entity *> &filters)¶ Read only configuration data for specified filter.
Parameters: - provider – An instance of
ServiceProvider. - filters – An instance of std::vector<Entity*> class, which contains one or more entities defined under a bundle.
Returns: An instance of std::vector<std::shared_ptr<Entity>> as identified by the filters if successful, instance of empty std::vector - otherwise.
Raises: YError, if an error has occurred.
- provider – An instance of
-
bool
update(ydk::ServiceProvider &provider, Entity &entity)¶ Update the entity.
Parameters: - provider – An instance of
ServiceProvider. - entity – An instance of
Entityclass defined under a bundle.
Returns: true, if successful, false - otherwise.
Raises: YError, if an error has occurred.
- provider – An instance of
-
bool
update(ydk::ServiceProvider &provider, std::vector<Entity *> &entities)¶ Update multiple entities.
Parameters: - provider – An instance of
ServiceProvider. - entities – An instance of std::vector<Entity*> class, which contains one or more entities defined under a bundle.
Returns: true, if successful, false - otherwise.
Raises: YError, if an error has occurred.
- provider – An instance of
-
bool
delete_(ydk::ServiceProvider &provider, Entity &entity)¶ Delete the entity.
Parameters: - provider – An instance of
ServiceProvider. - entity – An instance of
Entityclass defined under a bundle.
Returns: true, if successful, false - otherwise.
Raises: YError, if an error has occurred.
- provider – An instance of
-
bool
delete_(ydk::ServiceProvider &provider, std::vector<Entity *> &entities)¶ Delete multiple entities.
Parameters: - provider – An instance of
ServiceProvider. - entity – An instance of std::vector<Entity*> class, which contains one or more entities defined under a bundle.
Returns: true, if successful, false - otherwise.
Raises: YError, if an error has occurred.
- provider – An instance of
-