models

package
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2021 License: MIT Imports: 5 Imported by: 23

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddAlertsRequest

type AddAlertsRequest []*Alert

AddAlertsRequest AddAlertsRequest

swagger:model AddAlertsRequest

func (AddAlertsRequest) Validate

func (m AddAlertsRequest) Validate(formats strfmt.Registry) error

Validate validates this add alerts request

type AddAlertsResponse

type AddAlertsResponse []string

AddAlertsResponse AddAlertsResponse

swagger:model AddAlertsResponse

func (AddAlertsResponse) Validate

func (m AddAlertsResponse) Validate(formats strfmt.Registry) error

Validate validates this add alerts response

type AddSignalsRequest

type AddSignalsRequest []*AddSignalsRequestItem

AddSignalsRequest add signals request

All signals request model

swagger:model AddSignalsRequest

func (AddSignalsRequest) Validate

func (m AddSignalsRequest) Validate(formats strfmt.Registry) error

Validate validates this add signals request

type AddSignalsRequestItem

type AddSignalsRequestItem struct {

	// created at
	CreatedAt string `json:"created_at,omitempty"`

	// machine id
	MachineID string `json:"machine_id,omitempty"`

	// a human readable message
	// Required: true
	Message *string `json:"message"`

	// scenario
	// Required: true
	Scenario *string `json:"scenario"`

	// scenario hash
	// Required: true
	ScenarioHash *string `json:"scenario_hash"`

	// scenario version
	// Required: true
	ScenarioVersion *string `json:"scenario_version"`

	// source
	// Required: true
	Source *Source `json:"source"`

	// start at
	// Required: true
	StartAt *string `json:"start_at"`

	// stop at
	// Required: true
	StopAt *string `json:"stop_at"`
}

AddSignalsRequestItem Signal

swagger:model AddSignalsRequestItem

func (*AddSignalsRequestItem) MarshalBinary

func (m *AddSignalsRequestItem) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*AddSignalsRequestItem) UnmarshalBinary

func (m *AddSignalsRequestItem) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*AddSignalsRequestItem) Validate

func (m *AddSignalsRequestItem) Validate(formats strfmt.Registry) error

Validate validates this add signals request item

type Alert

type Alert struct {

	// capacity
	// Required: true
	Capacity *int32 `json:"capacity"`

	// only relevant for GET, ignored in POST requests
	// Read Only: true
	CreatedAt string `json:"created_at,omitempty"`

	// decisions
	Decisions []*Decision `json:"decisions"`

	// the Meta of the events leading to overflow
	// Required: true
	Events []*Event `json:"events"`

	// events count
	// Required: true
	EventsCount *int32 `json:"events_count"`

	// only relevant for GET, ignored in POST requests
	// Read Only: true
	ID int64 `json:"id,omitempty"`

	// labels
	Labels []string `json:"labels"`

	// leakspeed
	// Required: true
	Leakspeed *string `json:"leakspeed"`

	// only relevant for APIL->APIC, ignored for cscli->APIL and crowdsec->APIL
	// Read Only: true
	MachineID string `json:"machine_id,omitempty"`

	// a human readable message
	// Required: true
	Message *string `json:"message"`

	// meta
	Meta Meta `json:"meta,omitempty"`

	// remediation
	Remediation bool `json:"remediation,omitempty"`

	// scenario
	// Required: true
	Scenario *string `json:"scenario"`

	// scenario hash
	// Required: true
	ScenarioHash *string `json:"scenario_hash"`

	// scenario version
	// Required: true
	ScenarioVersion *string `json:"scenario_version"`

	// simulated
	// Required: true
	Simulated *bool `json:"simulated"`

	// source
	// Required: true
	Source *Source `json:"source"`

	// start at
	// Required: true
	StartAt *string `json:"start_at"`

	// stop at
	// Required: true
	StopAt *string `json:"stop_at"`
}

Alert Alert

swagger:model Alert

func (*Alert) GetScenario

func (a *Alert) GetScenario() string

func (*Alert) GetScope

func (a *Alert) GetScope() string

func (*Alert) HasRemediation

func (a *Alert) HasRemediation() bool

func (*Alert) MarshalBinary

func (m *Alert) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*Alert) UnmarshalBinary

func (m *Alert) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*Alert) Validate

func (m *Alert) Validate(formats strfmt.Registry) error

Validate validates this alert

type Decision

type Decision struct {

	// duration
	// Required: true
	Duration *string `json:"duration"`

	// (only relevant for GET ops) the unique id
	// Read Only: true
	ID int64 `json:"id,omitempty"`

	// the origin of the decision : cscli, crowdsec
	// Required: true
	Origin *string `json:"origin"`

	// scenario
	// Required: true
	Scenario *string `json:"scenario"`

	// the scope of decision : does it apply to an IP, a range, a username, etc
	// Required: true
	Scope *string `json:"scope"`

	// true if the decision result from a scenario in simulation mode
	// Read Only: true
	Simulated *bool `json:"simulated,omitempty"`

	// the type of decision, might be 'ban', 'captcha' or something custom. Ignored when watcher (cscli/crowdsec) is pushing to APIL.
	// Required: true
	Type *string `json:"type"`

	// the value of the decision scope : an IP, a range, a username, etc
	// Required: true
	Value *string `json:"value"`
}

Decision Decision

swagger:model Decision

func (*Decision) MarshalBinary

func (m *Decision) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*Decision) UnmarshalBinary

func (m *Decision) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*Decision) Validate

func (m *Decision) Validate(formats strfmt.Registry) error

Validate validates this decision

type DecisionsStreamResponse

type DecisionsStreamResponse struct {

	// deleted
	Deleted GetDecisionsResponse `json:"deleted,omitempty"`

	// new
	New GetDecisionsResponse `json:"new,omitempty"`
}

DecisionsStreamResponse DecisionsStreamResponse

swagger:model DecisionsStreamResponse

func (*DecisionsStreamResponse) MarshalBinary

func (m *DecisionsStreamResponse) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*DecisionsStreamResponse) UnmarshalBinary

func (m *DecisionsStreamResponse) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*DecisionsStreamResponse) Validate

func (m *DecisionsStreamResponse) Validate(formats strfmt.Registry) error

Validate validates this decisions stream response

type DeleteAlertsResponse

type DeleteAlertsResponse struct {

	// number of deleted alerts
	NbDeleted string `json:"nbDeleted,omitempty"`
}

DeleteAlertsResponse DeleteAlertsResponse

swagger:model DeleteAlertsResponse

func (*DeleteAlertsResponse) MarshalBinary

func (m *DeleteAlertsResponse) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*DeleteAlertsResponse) UnmarshalBinary

func (m *DeleteAlertsResponse) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*DeleteAlertsResponse) Validate

func (m *DeleteAlertsResponse) Validate(formats strfmt.Registry) error

Validate validates this delete alerts response

type DeleteDecisionResponse

type DeleteDecisionResponse struct {

	// number of deleted decisions
	NbDeleted string `json:"nbDeleted,omitempty"`
}

DeleteDecisionResponse DeleteDecisionResponse

swagger:model DeleteDecisionResponse

func (*DeleteDecisionResponse) MarshalBinary

func (m *DeleteDecisionResponse) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*DeleteDecisionResponse) UnmarshalBinary

func (m *DeleteDecisionResponse) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*DeleteDecisionResponse) Validate

func (m *DeleteDecisionResponse) Validate(formats strfmt.Registry) error

Validate validates this delete decision response

type ErrorResponse

type ErrorResponse struct {

	// more detail on individual errors
	Errors string `json:"errors,omitempty"`

	// Error message
	// Required: true
	Message *string `json:"message"`
}

ErrorResponse error response

error response return by the API

swagger:model ErrorResponse

func (*ErrorResponse) MarshalBinary

func (m *ErrorResponse) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*ErrorResponse) UnmarshalBinary

func (m *ErrorResponse) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*ErrorResponse) Validate

func (m *ErrorResponse) Validate(formats strfmt.Registry) error

Validate validates this error response

type Event

type Event struct {

	// meta
	// Required: true
	Meta Meta `json:"meta"`

	// timestamp
	// Required: true
	Timestamp *string `json:"timestamp"`
}

Event Event

swagger:model Event

func (*Event) MarshalBinary

func (m *Event) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*Event) UnmarshalBinary

func (m *Event) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*Event) Validate

func (m *Event) Validate(formats strfmt.Registry) error

Validate validates this event

type FlushDecisionResponse

type FlushDecisionResponse struct {

	// decision id
	DecisionID string `json:"decision_id,omitempty"`
}

FlushDecisionResponse FlushDecisionResponse

swagger:model FlushDecisionResponse

func (*FlushDecisionResponse) MarshalBinary

func (m *FlushDecisionResponse) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*FlushDecisionResponse) UnmarshalBinary

func (m *FlushDecisionResponse) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*FlushDecisionResponse) Validate

func (m *FlushDecisionResponse) Validate(formats strfmt.Registry) error

Validate validates this flush decision response

type GetAlertsResponse

type GetAlertsResponse []*Alert

GetAlertsResponse AlertsResponse

swagger:model GetAlertsResponse

func (GetAlertsResponse) Validate

func (m GetAlertsResponse) Validate(formats strfmt.Registry) error

Validate validates this get alerts response

type GetDecisionsResponse

type GetDecisionsResponse []*Decision

GetDecisionsResponse GetDecisionsResponse

swagger:model GetDecisionsResponse

func (GetDecisionsResponse) Validate

func (m GetDecisionsResponse) Validate(formats strfmt.Registry) error

Validate validates this get decisions response

type Meta

type Meta []*MetaItems0

Meta Meta

the Meta data of the Alert itself

swagger:model Meta

func (Meta) Validate

func (m Meta) Validate(formats strfmt.Registry) error

Validate validates this meta

type MetaItems0

type MetaItems0 struct {

	// key
	Key string `json:"key,omitempty"`

	// value
	Value string `json:"value,omitempty"`
}

MetaItems0 meta items0

swagger:model MetaItems0

func (*MetaItems0) MarshalBinary

func (m *MetaItems0) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*MetaItems0) UnmarshalBinary

func (m *MetaItems0) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*MetaItems0) Validate

func (m *MetaItems0) Validate(formats strfmt.Registry) error

Validate validates this meta items0

type Metrics

type Metrics struct {

	// the local version of crowdsec/apil
	// Required: true
	ApilVersion *string `json:"apil_version"`

	// bouncers
	// Required: true
	Bouncers []*MetricsSoftInfo `json:"bouncers"`

	// machines
	// Required: true
	Machines []*MetricsSoftInfo `json:"machines"`
}

Metrics Metrics

swagger:model Metrics

func (*Metrics) MarshalBinary

func (m *Metrics) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*Metrics) UnmarshalBinary

func (m *Metrics) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*Metrics) Validate

func (m *Metrics) Validate(formats strfmt.Registry) error

Validate validates this metrics

type MetricsSoftInfo

type MetricsSoftInfo struct {

	// name of the component
	Name string `json:"name,omitempty"`

	// software version
	Version string `json:"version,omitempty"`
}

MetricsSoftInfo MetricsSoftInfo

Software version info (so we can warn users about out-of-date software). The software name and the version are "guessed" from the user-agent

swagger:model MetricsSoftInfo

func (*MetricsSoftInfo) MarshalBinary

func (m *MetricsSoftInfo) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*MetricsSoftInfo) UnmarshalBinary

func (m *MetricsSoftInfo) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*MetricsSoftInfo) Validate

func (m *MetricsSoftInfo) Validate(formats strfmt.Registry) error

Validate validates this metrics soft info

type Source

type Source struct {

	// provided as a convenience when the source is an IP
	AsName string `json:"as_name,omitempty"`

	// provided as a convenience when the source is an IP
	AsNumber string `json:"as_number,omitempty"`

	// cn
	Cn string `json:"cn,omitempty"`

	// provided as a convenience when the source is an IP
	IP string `json:"ip,omitempty"`

	// latitude
	Latitude float32 `json:"latitude,omitempty"`

	// longitude
	Longitude float32 `json:"longitude,omitempty"`

	// provided as a convenience when the source is an IP
	Range string `json:"range,omitempty"`

	// the scope of a source : ip,range,username,etc
	// Required: true
	Scope *string `json:"scope"`

	// the value of a source : the ip, the range, the username,etc
	// Required: true
	Value *string `json:"value"`
}

Source Source

swagger:model Source

func (*Source) MarshalBinary

func (m *Source) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*Source) UnmarshalBinary

func (m *Source) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*Source) Validate

func (m *Source) Validate(formats strfmt.Registry) error

Validate validates this source

type TopxResponse

type TopxResponse struct {

	// We keep the deleted array for the duration of the initial decision. So that when the initial decision is expired, it won't be present in deleted array anymore.
	Deleted [][]GetDecisionsResponse `json:"deleted"`

	// new
	New [][]GetDecisionsResponse `json:"new"`
}

TopxResponse TopxResponse

swagger:model TopxResponse

func (*TopxResponse) MarshalBinary

func (m *TopxResponse) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*TopxResponse) UnmarshalBinary

func (m *TopxResponse) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*TopxResponse) Validate

func (m *TopxResponse) Validate(formats strfmt.Registry) error

Validate validates this topx response

type WatcherAuthRequest

type WatcherAuthRequest struct {

	// machine id
	// Required: true
	MachineID *string `json:"machine_id"`

	// password
	// Required: true
	// Format: password
	Password *strfmt.Password `json:"password"`

	// the list of scenarios enabled on the watcher
	Scenarios []string `json:"scenarios"`
}

WatcherAuthRequest WatcherAuthRequest

swagger:model WatcherAuthRequest

func (*WatcherAuthRequest) MarshalBinary

func (m *WatcherAuthRequest) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*WatcherAuthRequest) UnmarshalBinary

func (m *WatcherAuthRequest) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*WatcherAuthRequest) Validate

func (m *WatcherAuthRequest) Validate(formats strfmt.Registry) error

Validate validates this watcher auth request

type WatcherAuthResponse

type WatcherAuthResponse struct {

	// code
	Code int64 `json:"code,omitempty"`

	// expire
	Expire string `json:"expire,omitempty"`

	// token
	Token string `json:"token,omitempty"`
}

WatcherAuthResponse WatcherAuthResponse

the response of a successful authentication

swagger:model WatcherAuthResponse

func (*WatcherAuthResponse) MarshalBinary

func (m *WatcherAuthResponse) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*WatcherAuthResponse) UnmarshalBinary

func (m *WatcherAuthResponse) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*WatcherAuthResponse) Validate

func (m *WatcherAuthResponse) Validate(formats strfmt.Registry) error

Validate validates this watcher auth response

type WatcherRegistrationRequest

type WatcherRegistrationRequest struct {

	// machine id
	// Required: true
	MachineID *string `json:"machine_id"`

	// password
	// Required: true
	// Format: password
	Password *strfmt.Password `json:"password"`
}

WatcherRegistrationRequest WatcherRegistrationRequest

swagger:model WatcherRegistrationRequest

func (*WatcherRegistrationRequest) MarshalBinary

func (m *WatcherRegistrationRequest) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*WatcherRegistrationRequest) UnmarshalBinary

func (m *WatcherRegistrationRequest) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*WatcherRegistrationRequest) Validate

func (m *WatcherRegistrationRequest) Validate(formats strfmt.Registry) error

Validate validates this watcher registration request

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL