add lapi metrics in swagger and models
This commit is contained in:
parent
f0853188ce
commit
7b093b925e
|
@ -19,6 +19,9 @@ import (
|
||||||
// swagger:model AllMetrics
|
// swagger:model AllMetrics
|
||||||
type AllMetrics struct {
|
type AllMetrics struct {
|
||||||
|
|
||||||
|
// lapi
|
||||||
|
Lapi *LapiMetrics `json:"lapi,omitempty"`
|
||||||
|
|
||||||
// log processors metrics
|
// log processors metrics
|
||||||
LogProcessors []*LogProcessorsMetrics `json:"log_processors"`
|
LogProcessors []*LogProcessorsMetrics `json:"log_processors"`
|
||||||
|
|
||||||
|
@ -30,6 +33,10 @@ type AllMetrics struct {
|
||||||
func (m *AllMetrics) Validate(formats strfmt.Registry) error {
|
func (m *AllMetrics) Validate(formats strfmt.Registry) error {
|
||||||
var res []error
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validateLapi(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
if err := m.validateLogProcessors(formats); err != nil {
|
if err := m.validateLogProcessors(formats); err != nil {
|
||||||
res = append(res, err)
|
res = append(res, err)
|
||||||
}
|
}
|
||||||
|
@ -44,6 +51,25 @@ func (m *AllMetrics) Validate(formats strfmt.Registry) error {
|
||||||
return nil
|
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 {
|
func (m *AllMetrics) validateLogProcessors(formats strfmt.Registry) error {
|
||||||
if swag.IsZero(m.LogProcessors) { // not required
|
if swag.IsZero(m.LogProcessors) { // not required
|
||||||
return nil
|
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 {
|
func (m *AllMetrics) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||||
var res []error
|
var res []error
|
||||||
|
|
||||||
|
if err := m.contextValidateLapi(ctx, formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
if err := m.contextValidateLogProcessors(ctx, formats); err != nil {
|
if err := m.contextValidateLogProcessors(ctx, formats); err != nil {
|
||||||
res = append(res, err)
|
res = append(res, err)
|
||||||
}
|
}
|
||||||
|
@ -114,6 +144,27 @@ func (m *AllMetrics) ContextValidate(ctx context.Context, formats strfmt.Registr
|
||||||
return nil
|
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 {
|
func (m *AllMetrics) contextValidateLogProcessors(ctx context.Context, formats strfmt.Registry) error {
|
||||||
|
|
||||||
for i := 0; i < len(m.LogProcessors); i++ {
|
for i := 0; i < len(m.LogProcessors); i++ {
|
||||||
|
|
|
@ -1060,11 +1060,14 @@ definitions:
|
||||||
last_push:
|
last_push:
|
||||||
type: integer
|
type: integer
|
||||||
description: last push date
|
description: last push date
|
||||||
#items:
|
LapiMetrics:
|
||||||
# allOf:
|
title: LapiMetrics
|
||||||
# - $ref: '#/definitions/BaseMetrics'
|
type: object
|
||||||
# - type: object
|
allOf:
|
||||||
|
- $ref: '#/definitions/BaseMetrics'
|
||||||
|
- properties:
|
||||||
|
console_options:
|
||||||
|
$ref: '#/definitions/ConsoleOptions'
|
||||||
AllMetrics:
|
AllMetrics:
|
||||||
title: AllMetrics
|
title: AllMetrics
|
||||||
type: object
|
type: object
|
||||||
|
@ -1079,6 +1082,8 @@ definitions:
|
||||||
items:
|
items:
|
||||||
$ref: '#/definitions/LogProcessorsMetrics'
|
$ref: '#/definitions/LogProcessorsMetrics'
|
||||||
description: log processors metrics
|
description: log processors metrics
|
||||||
|
lapi:
|
||||||
|
$ref: '#/definitions/LapiMetrics'
|
||||||
BaseMetrics:
|
BaseMetrics:
|
||||||
title: BaseMetrics
|
title: BaseMetrics
|
||||||
type: object
|
type: object
|
||||||
|
|
Loading…
Reference in a new issue