15
15
#include "log.h"
16
16
#include "mlops-agent-interface.h"
17
17
#include "mlops-agent-internal.h"
18
+ #include "mlops-agent-node.h"
19
+ #include "service-db-util.h"
18
20
19
21
/**
20
22
* @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)
26
28
g_return_val_if_reached (- EINVAL );
27
29
}
28
30
29
- return 0 ;
31
+ return svcdb_pipeline_set ( name , pipeline_desc ) ;
30
32
}
31
33
32
34
/**
@@ -39,7 +41,7 @@ ml_agent_pipeline_get_description (const char *name, char **pipeline_desc)
39
41
g_return_val_if_reached (- EINVAL );
40
42
}
41
43
42
- return 0 ;
44
+ return svcdb_pipeline_get ( name , pipeline_desc ) ;
43
45
}
44
46
45
47
/**
@@ -52,7 +54,7 @@ ml_agent_pipeline_delete (const char *name)
52
54
g_return_val_if_reached (- EINVAL );
53
55
}
54
56
55
- return 0 ;
57
+ return svcdb_pipeline_delete ( name ) ;
56
58
}
57
59
58
60
/**
@@ -65,7 +67,7 @@ ml_agent_pipeline_launch (const char *name, int64_t * id)
65
67
g_return_val_if_reached (- EINVAL );
66
68
}
67
69
68
- return 0 ;
70
+ return mlops_node_create ( name , MLOPS_NODE_TYPE_PIPELINE , id ) ;
69
71
}
70
72
71
73
/**
@@ -74,7 +76,7 @@ ml_agent_pipeline_launch (const char *name, int64_t * id)
74
76
int
75
77
ml_agent_pipeline_start (const int64_t id )
76
78
{
77
- return 0 ;
79
+ return mlops_node_start ( id ) ;
78
80
}
79
81
80
82
/**
@@ -83,7 +85,7 @@ ml_agent_pipeline_start (const int64_t id)
83
85
int
84
86
ml_agent_pipeline_stop (const int64_t id )
85
87
{
86
- return 0 ;
88
+ return mlops_node_stop ( id ) ;
87
89
}
88
90
89
91
/**
@@ -92,7 +94,7 @@ ml_agent_pipeline_stop (const int64_t id)
92
94
int
93
95
ml_agent_pipeline_destroy (const int64_t id )
94
96
{
95
- return 0 ;
97
+ return mlops_node_destroy ( id ) ;
96
98
}
97
99
98
100
/**
@@ -101,7 +103,7 @@ ml_agent_pipeline_destroy (const int64_t id)
101
103
int
102
104
ml_agent_pipeline_get_state (const int64_t id , int * state )
103
105
{
104
- return 0 ;
106
+ return mlops_node_get_state ( id , ( GstState * ) state ) ;
105
107
}
106
108
107
109
/**
@@ -115,7 +117,8 @@ ml_agent_model_register (const char *name, const char *path,
115
117
if (!STR_IS_VALID (name ) || !STR_IS_VALID (path ) || !version ) {
116
118
g_return_val_if_reached (- EINVAL );
117
119
}
118
- return 0 ;
120
+
121
+ return svcdb_model_add (name , path , activate , description , app_info , version );
119
122
}
120
123
121
124
/**
@@ -128,7 +131,8 @@ ml_agent_model_update_description (const char *name,
128
131
if (!STR_IS_VALID (name ) || !STR_IS_VALID (description ) || version == 0U ) {
129
132
g_return_val_if_reached (- EINVAL );
130
133
}
131
- return 0 ;
134
+
135
+ return svcdb_model_update_description (name , version , description );
132
136
}
133
137
134
138
/**
@@ -141,7 +145,7 @@ ml_agent_model_activate (const char *name, const uint32_t version)
141
145
g_return_val_if_reached (- EINVAL );
142
146
}
143
147
144
- return 0 ;
148
+ return svcdb_model_activate ( name , version ) ;
145
149
}
146
150
147
151
/**
@@ -154,7 +158,7 @@ ml_agent_model_get (const char *name, const uint32_t version, char **model_info)
154
158
g_return_val_if_reached (- EINVAL );
155
159
}
156
160
157
- return 0 ;
161
+ return svcdb_model_get ( name , version , model_info ) ;
158
162
}
159
163
160
164
/**
@@ -167,7 +171,7 @@ ml_agent_model_get_activated (const char *name, char **model_info)
167
171
g_return_val_if_reached (- EINVAL );
168
172
}
169
173
170
- return 0 ;
174
+ return svcdb_model_get_activated ( name , model_info ) ;
171
175
}
172
176
173
177
/**
@@ -180,7 +184,7 @@ ml_agent_model_get_all (const char *name, char **model_info)
180
184
g_return_val_if_reached (- EINVAL );
181
185
}
182
186
183
- return 0 ;
187
+ return svcdb_model_get_all ( name , model_info ) ;
184
188
}
185
189
186
190
/**
@@ -195,7 +199,7 @@ ml_agent_model_delete (const char *name, const uint32_t version,
195
199
g_return_val_if_reached (- EINVAL );
196
200
}
197
201
198
- return 0 ;
202
+ return svcdb_model_delete ( name , version , force ) ;
199
203
}
200
204
201
205
/**
@@ -209,7 +213,7 @@ ml_agent_resource_add (const char *name, const char *path,
209
213
g_return_val_if_reached (- EINVAL );
210
214
}
211
215
212
- return 0 ;
216
+ return svcdb_resource_add ( name , path , description , app_info ) ;
213
217
}
214
218
215
219
/**
@@ -222,7 +226,7 @@ ml_agent_resource_delete (const char *name)
222
226
g_return_val_if_reached (- EINVAL );
223
227
}
224
228
225
- return 0 ;
229
+ return svcdb_resource_delete ( name ) ;
226
230
}
227
231
228
232
/**
@@ -235,5 +239,5 @@ ml_agent_resource_get (const char *name, char **res_info)
235
239
g_return_val_if_reached (- EINVAL );
236
240
}
237
241
238
- return 0 ;
242
+ return svcdb_resource_get ( name , res_info ) ;
239
243
}
0 commit comments