1111 Create (ctx context.Context , opts * model.RuntimeInstallationArgs ) (* model.RuntimeCreationResponse , error )
1212 Get (ctx context.Context , name string ) (* model.Runtime , error )
1313 List (ctx context.Context ) ([]model.Runtime , error )
14+ ReportErrors (ctx context.Context , opts * model.ReportRuntimeErrorsArgs ) (int , error )
1415 Delete (ctx context.Context , runtimeName string ) (int , error )
1516 }
1617
2021
2122 graphqlRuntimesResponse struct {
2223 Data struct {
23- Runtimes model.RuntimePage
24+ Runtimes model.RuntimeSlice
2425 }
2526 Errors []graphqlError
2627 }
@@ -39,6 +40,13 @@ type (
3940 Errors []graphqlError
4041 }
4142
43+ graphQlReportRuntimeErrorsResponse struct {
44+ Data struct {
45+ ReportRuntimeErrors int
46+ }
47+ Errors []graphqlError
48+ }
49+
4250 graphQlDeleteRuntimeResponse struct {
4351 Data struct {
4452 DeleteRuntime int
@@ -175,6 +183,33 @@ func (r *argoRuntime) List(ctx context.Context) ([]model.Runtime, error) {
175183 return runtimes , nil
176184}
177185
186+ func (r * argoRuntime ) ReportErrors (ctx context.Context , opts * model.ReportRuntimeErrorsArgs ) (int , error ) {
187+ jsonData := map [string ]interface {}{
188+ "query" : `
189+ mutation ReportRuntimeErrors(
190+ $reportErrorsArgs: ReportRuntimeErrorsArgs!
191+ ) {
192+ reportRuntimeErrors(reportErrorsArgs: $reportErrorsArgs)
193+ }
194+ ` ,
195+ "variables" : map [string ]interface {}{
196+ "reportErrorsArgs" : opts ,
197+ },
198+ }
199+
200+ res := graphQlReportRuntimeErrorsResponse {}
201+ err := r .codefresh .graphqlAPI (ctx , jsonData , & res )
202+ if err != nil {
203+ return 0 , fmt .Errorf ("failed making a graphql API call to runtimeErrorReport: %w" , err )
204+ }
205+
206+ if len (res .Errors ) > 0 {
207+ return 0 , graphqlErrorResponse {errors : res .Errors }
208+ }
209+
210+ return res .Data .ReportRuntimeErrors , nil
211+ }
212+
178213func (r * argoRuntime ) Delete (ctx context.Context , runtimeName string ) (int , error ) {
179214 jsonData := map [string ]interface {}{
180215 "query" : `
0 commit comments