centreonapi

package
v21.0.7 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Disable = "0"
	Enable  = "1"
	Default = "2"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	Service() ServiceAPI
	ServiceTemplate() ServiceTemplateAPI
	ServiceGroup() ServiceGroupAPI
	Client() *resty.Client
	Auth() (err error)
}

func New

func New(client *resty.Client, config *models.Config) API

New permit to get API handler

type APIImpl

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

APIImpl implement the API interface

func (*APIImpl) Auth added in v21.0.2

func (api *APIImpl) Auth() (err error)

func (*APIImpl) Client

func (api *APIImpl) Client() *resty.Client

Client permit to get instance of resty client

func (*APIImpl) Service

func (api *APIImpl) Service() ServiceAPI

Service permit to get service API handler

func (*APIImpl) ServiceGroup added in v21.0.7

func (api *APIImpl) ServiceGroup() ServiceGroupAPI

ServiceGroup permit to get service group API handler

func (*APIImpl) ServiceTemplate

func (api *APIImpl) ServiceTemplate() ServiceTemplateAPI

ServiceTemplate permit to get service template API handler

type Host

type Host struct {
}

type HostModel

type HostModel interface {
}

type Payload

type Payload struct {
	Action string `json:"action,omitempty"`
	Object string `json:"object,omitempty"`
	Values string `json:"values,omitempty"`
}

Payload represent payload API object

func NewPayload

func NewPayload(action, object, values string, params ...interface{}) *Payload

NewPayload permit to init payload object

type Result

type Result struct {
	Result json.RawMessage `json:"result,omitempty"`
}

Result represent API result object

type ResultTest

type ResultTest struct {
	Result interface{} `json:"result,omitempty"`
}

type ServiceAPI

type ServiceAPI interface {
	Get(host, name string) (service *models.ServiceGet, err error)
	List() (services []*models.ServiceGet, err error)
	SetHost(host, name, newHost string) (err error)
	// contains filtered or unexported methods
}

func NewService

func NewService(client *resty.Client) ServiceAPI

NewService permit to get service hendler that implement ServiceAPI interface

type ServiceGroupAPI added in v21.0.7

type ServiceGroupAPI interface {
	Get(name string) (serviceGroup *models.ServiceGroup, err error)
	List() (serviceGroups []*models.ServiceGroup, err error)
	Add(name, description string) (err error)
	Delete(name string) (err error)
	SetParam(serviceGroupName, name, value string) (err error)
	GetParam(serviceGroupName string, params []string) (values map[string]string, err error)
}

func NewServiceGroup added in v21.0.7

func NewServiceGroup(client *resty.Client) ServiceGroupAPI

NewService permit to get serviceGroup handler that implement ServiceGroupAPI interface

type ServiceGroupImpl added in v21.0.7

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

func (*ServiceGroupImpl) Add added in v21.0.7

func (s *ServiceGroupImpl) Add(name, description string) (err error)

Add permit to create to service group

func (*ServiceGroupImpl) Delete added in v21.0.7

func (s *ServiceGroupImpl) Delete(name string) (err error)

Delete permit to delete the service group

func (*ServiceGroupImpl) Get added in v21.0.7

func (s *ServiceGroupImpl) Get(name string) (sg *models.ServiceGroup, err error)

Get permit to get one service group by it's name

func (*ServiceGroupImpl) GetParam added in v21.0.7

func (s *ServiceGroupImpl) GetParam(serviceGroupName string, params []string) (values map[string]string, err error)

GetParam permit to get extra properties from service group

func (*ServiceGroupImpl) List added in v21.0.7

func (s *ServiceGroupImpl) List() (serviceGroups []*models.ServiceGroup, err error)

List permit to get all serviceGroups

func (*ServiceGroupImpl) SetParam added in v21.0.7

func (s *ServiceGroupImpl) SetParam(serviceGroupName, name, value string) (err error)

SetParam permit to set extra properties on service group

type ServiceImpl

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

func (ServiceImpl) Add

func (s ServiceImpl) Add(host, name, template string) (err error)

Add permit to create new service. It call with add API

func (ServiceImpl) Delete

func (s ServiceImpl) Delete(host, name string) (err error)

Delete permit to remove on service. It call with del API

func (ServiceImpl) DeleteCategories

func (s ServiceImpl) DeleteCategories(host, service string, categories []string) (err error)

Delete categories permit to delete categories on service

func (ServiceImpl) DeleteMacro

func (s ServiceImpl) DeleteMacro(host, service, name string) (err error)

DeleteMacro permit to remove macro on service

func (ServiceImpl) DeleteServiceGroups

func (s ServiceImpl) DeleteServiceGroups(host, service string, serviceGroups []string) (err error)

DeleteServiceGroups permit to delete service groups on service

func (ServiceImpl) DeleteTraps

func (s ServiceImpl) DeleteTraps(host, service string, traps []string) (err error)

DeleteTraps permit to delete traps on service

func (*ServiceImpl) Get

func (s *ServiceImpl) Get(host, name string) (service *models.ServiceGet, err error)

Get permit to get one service

func (ServiceImpl) GetCategories

func (s ServiceImpl) GetCategories(host, service string) (categories []string, err error)

GetCategories permit to get all categories on service

func (ServiceImpl) GetMacros

func (s ServiceImpl) GetMacros(host, service string) (macros []*models.Macro, err error)

GetMacros permit to get all macros on service

func (ServiceImpl) GetParam

func (s ServiceImpl) GetParam(host, service string, params []string) (values map[string]string, err error)

GetParam permit to get property value on service

func (ServiceImpl) GetServiceGroups

func (s ServiceImpl) GetServiceGroups(host, service string) (serviceGroups []string, err error)

GetServiceGroups permit to get all service groups on service

func (ServiceImpl) GetTraps

func (s ServiceImpl) GetTraps(host, service string) (traps []string, err error)

GetTraps permit to get all traps on service

func (*ServiceImpl) List

func (s *ServiceImpl) List() (services []*models.ServiceGet, err error)

List permit to get all services

func (ServiceImpl) SetCategories

func (s ServiceImpl) SetCategories(host, service string, categories []string) (err error)

SetCategories permit to set categories on service

func (*ServiceImpl) SetHost added in v21.0.5

func (s *ServiceImpl) SetHost(host, name, newHost string) (err error)

func (ServiceImpl) SetMacro

func (s ServiceImpl) SetMacro(host, service string, macro *models.Macro) (err error)

SetMacro permit to set macro on service

func (ServiceImpl) SetParam

func (s ServiceImpl) SetParam(host, service, name, value string) (err error)

SetParam permit to set property value on service

func (ServiceImpl) SetServiceGroups

func (s ServiceImpl) SetServiceGroups(host, service string, serviceGroups []string) (err error)

SetServiceGroups permit to set service groups on service

func (ServiceImpl) SetTraps

func (s ServiceImpl) SetTraps(host, service string, traps []string) (err error)

SetTraps permit to set traps on service

type ServiceTemplateAPI

type ServiceTemplateAPI interface {
	Get(host, name string) (service *models.ServiceTemplateGet, err error)
	List() (services []*models.ServiceTemplateGet, err error)
	// contains filtered or unexported methods
}

func NewServiceTemplate

func NewServiceTemplate(client *resty.Client) ServiceTemplateAPI

NewServiceTemplate permit to get service template handler that implement ServiceTemplateAPI interface

type ServiceTemplateImpl

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

func (ServiceTemplateImpl) Add

func (s ServiceTemplateImpl) Add(host, name, template string) (err error)

Add permit to create new service. It call with add API

func (ServiceTemplateImpl) Delete

func (s ServiceTemplateImpl) Delete(host, name string) (err error)

Delete permit to remove on service. It call with del API

func (ServiceTemplateImpl) DeleteCategories

func (s ServiceTemplateImpl) DeleteCategories(host, service string, categories []string) (err error)

Delete categories permit to delete categories on service

func (ServiceTemplateImpl) DeleteMacro

func (s ServiceTemplateImpl) DeleteMacro(host, service, name string) (err error)

DeleteMacro permit to remove macro on service

func (ServiceTemplateImpl) DeleteServiceGroups

func (s ServiceTemplateImpl) DeleteServiceGroups(host, service string, serviceGroups []string) (err error)

DeleteServiceGroups permit to delete service groups on service

func (ServiceTemplateImpl) DeleteTraps

func (s ServiceTemplateImpl) DeleteTraps(host, service string, traps []string) (err error)

DeleteTraps permit to delete traps on service

func (*ServiceTemplateImpl) Get

func (s *ServiceTemplateImpl) Get(host, name string) (service *models.ServiceTemplateGet, err error)

Get permit to get one service template

func (ServiceTemplateImpl) GetCategories

func (s ServiceTemplateImpl) GetCategories(host, service string) (categories []string, err error)

GetCategories permit to get all categories on service

func (ServiceTemplateImpl) GetMacros

func (s ServiceTemplateImpl) GetMacros(host, service string) (macros []*models.Macro, err error)

GetMacros permit to get all macros on service

func (ServiceTemplateImpl) GetParam

func (s ServiceTemplateImpl) GetParam(host, service string, params []string) (values map[string]string, err error)

GetParam permit to get property value on service

func (ServiceTemplateImpl) GetServiceGroups

func (s ServiceTemplateImpl) GetServiceGroups(host, service string) (serviceGroups []string, err error)

GetServiceGroups permit to get all service groups on service

func (ServiceTemplateImpl) GetTraps

func (s ServiceTemplateImpl) GetTraps(host, service string) (traps []string, err error)

GetTraps permit to get all traps on service

func (*ServiceTemplateImpl) List

func (s *ServiceTemplateImpl) List() (services []*models.ServiceTemplateGet, err error)

List permit to get all service templates

func (ServiceTemplateImpl) SetCategories

func (s ServiceTemplateImpl) SetCategories(host, service string, categories []string) (err error)

SetCategories permit to set categories on service

func (ServiceTemplateImpl) SetMacro

func (s ServiceTemplateImpl) SetMacro(host, service string, macro *models.Macro) (err error)

SetMacro permit to set macro on service

func (ServiceTemplateImpl) SetParam

func (s ServiceTemplateImpl) SetParam(host, service, name, value string) (err error)

SetParam permit to set property value on service

func (ServiceTemplateImpl) SetServiceGroups

func (s ServiceTemplateImpl) SetServiceGroups(host, service string, serviceGroups []string) (err error)

SetServiceGroups permit to set service groups on service

func (ServiceTemplateImpl) SetTraps

func (s ServiceTemplateImpl) SetTraps(host, service string, traps []string) (err error)

SetTraps permit to set traps on service

Jump to

Keyboard shortcuts

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