diff --git a/pkg/models/all_metrics.go b/pkg/models/all_metrics.go index 4f0b958bd..5865070e8 100644 --- a/pkg/models/all_metrics.go +++ b/pkg/models/all_metrics.go @@ -19,6 +19,9 @@ import ( // swagger:model AllMetrics type AllMetrics struct { + // lapi + Lapi *LapiMetrics `json:"lapi,omitempty"` + // log processors metrics LogProcessors []*LogProcessorsMetrics `json:"log_processors"` @@ -30,6 +33,10 @@ type AllMetrics struct { func (m *AllMetrics) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateLapi(formats); err != nil { + res = append(res, err) + } + if err := m.validateLogProcessors(formats); err != nil { res = append(res, err) } @@ -44,6 +51,25 @@ func (m *AllMetrics) Validate(formats strfmt.Registry) error { return nil } +func (m *AllMetrics) validateLapi(formats strfmt.Registry) error { + if swag.IsZero(m.Lapi) { // not required + return nil + } + + if m.Lapi != nil { + if err := m.Lapi.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("lapi") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("lapi") + } + return err + } + } + + return nil +} + func (m *AllMetrics) validateLogProcessors(formats strfmt.Registry) error { if swag.IsZero(m.LogProcessors) { // not required return nil @@ -100,6 +126,10 @@ func (m *AllMetrics) validateRemediationComponents(formats strfmt.Registry) erro func (m *AllMetrics) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error + if err := m.contextValidateLapi(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateLogProcessors(ctx, formats); err != nil { res = append(res, err) } @@ -114,6 +144,27 @@ func (m *AllMetrics) ContextValidate(ctx context.Context, formats strfmt.Registr return nil } +func (m *AllMetrics) contextValidateLapi(ctx context.Context, formats strfmt.Registry) error { + + if m.Lapi != nil { + + if swag.IsZero(m.Lapi) { // not required + return nil + } + + if err := m.Lapi.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("lapi") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("lapi") + } + return err + } + } + + return nil +} + func (m *AllMetrics) contextValidateLogProcessors(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.LogProcessors); i++ { diff --git a/pkg/models/localapi_swagger.yaml b/pkg/models/localapi_swagger.yaml index 55ef9e296..5a1bee3cd 100644 --- a/pkg/models/localapi_swagger.yaml +++ b/pkg/models/localapi_swagger.yaml @@ -1060,11 +1060,14 @@ definitions: last_push: type: integer description: last push date - #items: - # allOf: - # - $ref: '#/definitions/BaseMetrics' - # - type: object - + LapiMetrics: + title: LapiMetrics + type: object + allOf: + - $ref: '#/definitions/BaseMetrics' + - properties: + console_options: + $ref: '#/definitions/ConsoleOptions' AllMetrics: title: AllMetrics type: object @@ -1079,6 +1082,8 @@ definitions: items: $ref: '#/definitions/LogProcessorsMetrics' description: log processors metrics + lapi: + $ref: '#/definitions/LapiMetrics' BaseMetrics: title: BaseMetrics type: object