simplemonitor

package
v2.32.3 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2022 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateRequest

type CreateRequest struct {
	Target             string `validate:"required"`
	Description        string `validate:"min=0,max=512"`
	Tags               types.Tags
	IconID             types.ID
	MaxCheckAttempts   int                               `mapconv:"Settings.SimpleMonitor.MaxCheckAttempts" validate:"min=1,max=10"`
	RetryInterval      int                               `mapconv:"Settings.SimpleMonitor.RetryInterval" validate:"min=10,max=3600"`
	DelayLoop          int                               `mapconv:"Settings.SimpleMonitor.DelayLoop" validate:"min=60,max=3600"`
	Enabled            types.StringFlag                  `mapconv:"Settings.SimpleMonitor.Enabled"`
	HealthCheck        *sacloud.SimpleMonitorHealthCheck `mapconv:"Settings.SimpleMonitor.HealthCheck,recursive"`
	NotifyEmailEnabled types.StringFlag                  `mapconv:"Settings.SimpleMonitor.NotifyEmail.Enabled"`
	NotifyEmailHTML    types.StringFlag                  `mapconv:"Settings.SimpleMonitor.NotifyEmail.HTML"`
	NotifySlackEnabled types.StringFlag                  `mapconv:"Settings.SimpleMonitor.NotifySlack.Enabled"`
	SlackWebhooksURL   string                            `mapconv:"Settings.SimpleMonitor.NotifySlack.IncomingWebhooksURL"`
	NotifyInterval     int                               `mapconv:"Settings.SimpleMonitor.NotifyInterval" validate:"min=3600,max=259200"`
	Timeout            int
}

func (*CreateRequest) ToRequestParameter

func (req *CreateRequest) ToRequestParameter() (*sacloud.SimpleMonitorCreateRequest, error)

func (*CreateRequest) Validate

func (req *CreateRequest) Validate() error

type DeleteRequest

type DeleteRequest struct {
	ID types.ID `request:"-" validate:"required"`

	FailIfNotFound bool `request:"-"`
}

func (*DeleteRequest) Validate

func (req *DeleteRequest) Validate() error

type FindRequest

type FindRequest struct {
	Names []string `request:"-"`
	Tags  []string `request:"-"`

	Sort  search.SortKeys
	Count int
	From  int
}

func (*FindRequest) ToRequestParameter

func (req *FindRequest) ToRequestParameter() (*sacloud.FindCondition, error)

func (*FindRequest) Validate

func (req *FindRequest) Validate() error

type HealthRequest

type HealthRequest struct {
	ID types.ID `request:"-" validate:"required"`
}

func (*HealthRequest) Validate

func (req *HealthRequest) Validate() error

type MonitorResponseTimeRequest

type MonitorResponseTimeRequest struct {
	ID types.ID `request:"-" validate:"required"`

	Start time.Time
	End   time.Time
}

func (*MonitorResponseTimeRequest) Validate

func (req *MonitorResponseTimeRequest) Validate() error

type ReadRequest

type ReadRequest struct {
	ID types.ID `request:"-" validate:"required"`
}

func (*ReadRequest) Validate

func (req *ReadRequest) Validate() error

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service provides a high-level API of for SimpleMonitor

func New

func New(caller sacloud.APICaller) *Service

New returns new service instance of SimpleMonitor

func (*Service) Create

func (s *Service) Create(req *CreateRequest) (*sacloud.SimpleMonitor, error)

func (*Service) CreateWithContext

func (s *Service) CreateWithContext(ctx context.Context, req *CreateRequest) (*sacloud.SimpleMonitor, error)

func (*Service) Delete

func (s *Service) Delete(req *DeleteRequest) error

func (*Service) DeleteWithContext

func (s *Service) DeleteWithContext(ctx context.Context, req *DeleteRequest) error

func (*Service) Find

func (s *Service) Find(req *FindRequest) ([]*sacloud.SimpleMonitor, error)

func (*Service) FindWithContext

func (s *Service) FindWithContext(ctx context.Context, req *FindRequest) ([]*sacloud.SimpleMonitor, error)

func (*Service) Health

func (*Service) HealthWithContext

func (s *Service) HealthWithContext(ctx context.Context, req *HealthRequest) (*sacloud.SimpleMonitorHealthStatus, error)

func (*Service) MonitorResponseTime

func (s *Service) MonitorResponseTime(req *MonitorResponseTimeRequest) ([]*sacloud.MonitorResponseTimeSecValue, error)

func (*Service) MonitorResponseTimeWithContext

func (s *Service) MonitorResponseTimeWithContext(ctx context.Context, req *MonitorResponseTimeRequest) ([]*sacloud.MonitorResponseTimeSecValue, error)

func (*Service) Read

func (s *Service) Read(req *ReadRequest) (*sacloud.SimpleMonitor, error)

func (*Service) ReadWithContext

func (s *Service) ReadWithContext(ctx context.Context, req *ReadRequest) (*sacloud.SimpleMonitor, error)

func (*Service) Update

func (s *Service) Update(req *UpdateRequest) (*sacloud.SimpleMonitor, error)

func (*Service) UpdateWithContext

func (s *Service) UpdateWithContext(ctx context.Context, req *UpdateRequest) (*sacloud.SimpleMonitor, error)

type UpdateRequest

type UpdateRequest struct {
	ID types.ID `request:"-" validate:"required"`

	Description        *string                           `request:",omitempty" validate:"omitempty,min=1,max=512"`
	Tags               *types.Tags                       `request:",omitempty"`
	IconID             *types.ID                         `request:",omitempty"`
	MaxCheckAttempts   *int                              `request:",omitempty"`
	RetryInterval      *int                              `request:",omitempty"`
	DelayLoop          *int                              `request:",omitempty"`
	Enabled            *types.StringFlag                 `request:",omitempty"`
	HealthCheck        *sacloud.SimpleMonitorHealthCheck `request:",omitempty"`
	NotifyEmailEnabled *types.StringFlag                 `request:",omitempty"`
	NotifyEmailHTML    *types.StringFlag                 `request:",omitempty"`
	NotifySlackEnabled *types.StringFlag                 `request:",omitempty"`
	SlackWebhooksURL   *string                           `request:",omitempty"`
	NotifyInterval     *int                              `request:",omitempty"`
	Timeout            *int                              `request:",omitempty"`
	SettingsHash       string
}

func (*UpdateRequest) ToRequestParameter

func (req *UpdateRequest) ToRequestParameter(current *sacloud.SimpleMonitor) (*sacloud.SimpleMonitorUpdateRequest, error)

func (*UpdateRequest) Validate

func (req *UpdateRequest) Validate() error

Jump to

Keyboard shortcuts

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