1515#include "log.h"
1616#include "mlops-agent-interface.h"
1717#include "mlops-agent-internal.h"
18+ #include "mlops-agent-node.h"
19+ #include "service-db-util.h"
1820
1921/**
2022 * @brief An interface exported for setting the description of a pipeline.
@@ -26,7 +28,7 @@ ml_agent_pipeline_set_description (const char *name, const char *pipeline_desc)
2628 g_return_val_if_reached (- EINVAL );
2729 }
2830
29- return 0 ;
31+ return svcdb_pipeline_set ( name , pipeline_desc ) ;
3032}
3133
3234/**
@@ -39,7 +41,7 @@ ml_agent_pipeline_get_description (const char *name, char **pipeline_desc)
3941 g_return_val_if_reached (- EINVAL );
4042 }
4143
42- return 0 ;
44+ return svcdb_pipeline_get ( name , pipeline_desc ) ;
4345}
4446
4547/**
@@ -52,7 +54,7 @@ ml_agent_pipeline_delete (const char *name)
5254 g_return_val_if_reached (- EINVAL );
5355 }
5456
55- return 0 ;
57+ return svcdb_pipeline_delete ( name ) ;
5658}
5759
5860/**
@@ -65,7 +67,7 @@ ml_agent_pipeline_launch (const char *name, int64_t * id)
6567 g_return_val_if_reached (- EINVAL );
6668 }
6769
68- return 0 ;
70+ return mlops_node_create ( name , MLOPS_NODE_TYPE_PIPELINE , id ) ;
6971}
7072
7173/**
@@ -74,7 +76,7 @@ ml_agent_pipeline_launch (const char *name, int64_t * id)
7476int
7577ml_agent_pipeline_start (const int64_t id )
7678{
77- return 0 ;
79+ return mlops_node_start ( id ) ;
7880}
7981
8082/**
@@ -83,7 +85,7 @@ ml_agent_pipeline_start (const int64_t id)
8385int
8486ml_agent_pipeline_stop (const int64_t id )
8587{
86- return 0 ;
88+ return mlops_node_stop ( id ) ;
8789}
8890
8991/**
@@ -92,7 +94,7 @@ ml_agent_pipeline_stop (const int64_t id)
9294int
9395ml_agent_pipeline_destroy (const int64_t id )
9496{
95- return 0 ;
97+ return mlops_node_destroy ( id ) ;
9698}
9799
98100/**
@@ -101,7 +103,7 @@ ml_agent_pipeline_destroy (const int64_t id)
101103int
102104ml_agent_pipeline_get_state (const int64_t id , int * state )
103105{
104- return 0 ;
106+ return mlops_node_get_state ( id , ( GstState * ) state ) ;
105107}
106108
107109/**
@@ -115,7 +117,8 @@ ml_agent_model_register (const char *name, const char *path,
115117 if (!STR_IS_VALID (name ) || !STR_IS_VALID (path ) || !version ) {
116118 g_return_val_if_reached (- EINVAL );
117119 }
118- return 0 ;
120+
121+ return svcdb_model_add (name , path , activate , description , app_info , version );
119122}
120123
121124/**
@@ -128,7 +131,8 @@ ml_agent_model_update_description (const char *name,
128131 if (!STR_IS_VALID (name ) || !STR_IS_VALID (description ) || version == 0U ) {
129132 g_return_val_if_reached (- EINVAL );
130133 }
131- return 0 ;
134+
135+ return svcdb_model_update_description (name , version , description );
132136}
133137
134138/**
@@ -141,7 +145,7 @@ ml_agent_model_activate (const char *name, const uint32_t version)
141145 g_return_val_if_reached (- EINVAL );
142146 }
143147
144- return 0 ;
148+ return svcdb_model_activate ( name , version ) ;
145149}
146150
147151/**
@@ -154,7 +158,7 @@ ml_agent_model_get (const char *name, const uint32_t version, char **model_info)
154158 g_return_val_if_reached (- EINVAL );
155159 }
156160
157- return 0 ;
161+ return svcdb_model_get ( name , version , model_info ) ;
158162}
159163
160164/**
@@ -167,7 +171,7 @@ ml_agent_model_get_activated (const char *name, char **model_info)
167171 g_return_val_if_reached (- EINVAL );
168172 }
169173
170- return 0 ;
174+ return svcdb_model_get_activated ( name , model_info ) ;
171175}
172176
173177/**
@@ -180,7 +184,7 @@ ml_agent_model_get_all (const char *name, char **model_info)
180184 g_return_val_if_reached (- EINVAL );
181185 }
182186
183- return 0 ;
187+ return svcdb_model_get_all ( name , model_info ) ;
184188}
185189
186190/**
@@ -195,7 +199,7 @@ ml_agent_model_delete (const char *name, const uint32_t version,
195199 g_return_val_if_reached (- EINVAL );
196200 }
197201
198- return 0 ;
202+ return svcdb_model_delete ( name , version , force ) ;
199203}
200204
201205/**
@@ -209,7 +213,7 @@ ml_agent_resource_add (const char *name, const char *path,
209213 g_return_val_if_reached (- EINVAL );
210214 }
211215
212- return 0 ;
216+ return svcdb_resource_add ( name , path , description , app_info ) ;
213217}
214218
215219/**
@@ -222,7 +226,7 @@ ml_agent_resource_delete (const char *name)
222226 g_return_val_if_reached (- EINVAL );
223227 }
224228
225- return 0 ;
229+ return svcdb_resource_delete ( name ) ;
226230}
227231
228232/**
@@ -235,5 +239,5 @@ ml_agent_resource_get (const char *name, char **res_info)
235239 g_return_val_if_reached (- EINVAL );
236240 }
237241
238- return 0 ;
242+ return svcdb_resource_get ( name , res_info ) ;
239243}
0 commit comments