Documentation ¶
Index ¶
- Constants
- type API
- type APIImpl
- type Host
- type HostModel
- type Payload
- type Result
- type ResultTest
- type ServiceAPI
- type ServiceGroupAPI
- type ServiceGroupImpl
- func (s *ServiceGroupImpl) Add(name, description string) (err error)
- func (s *ServiceGroupImpl) Delete(name string) (err error)
- func (s *ServiceGroupImpl) Get(name string) (sg *models.ServiceGroup, err error)
- func (s *ServiceGroupImpl) GetParam(serviceGroupName string, params []string) (values map[string]string, err error)
- func (s *ServiceGroupImpl) List() (serviceGroups []*models.ServiceGroup, err error)
- func (s *ServiceGroupImpl) SetParam(serviceGroupName, name, value string) (err error)
- type ServiceImpl
- func (s ServiceImpl) Add(host, name, template string) (err error)
- func (s ServiceImpl) Delete(host, name string) (err error)
- func (s ServiceImpl) DeleteCategories(host, service string, categories []string) (err error)
- func (s ServiceImpl) DeleteMacro(host, service, name string) (err error)
- func (s ServiceImpl) DeleteServiceGroups(host, service string, serviceGroups []string) (err error)
- func (s ServiceImpl) DeleteTraps(host, service string, traps []string) (err error)
- func (s *ServiceImpl) Get(host, name string) (service *models.ServiceGet, err error)
- func (s ServiceImpl) GetCategories(host, service string) (categories []string, err error)
- func (s ServiceImpl) GetMacros(host, service string) (macros []*models.Macro, err error)
- func (s ServiceImpl) GetParam(host, service string, params []string) (values map[string]string, err error)
- func (s ServiceImpl) GetServiceGroups(host, service string) (serviceGroups []string, err error)
- func (s ServiceImpl) GetTraps(host, service string) (traps []string, err error)
- func (s *ServiceImpl) List() (services []*models.ServiceGet, err error)
- func (s ServiceImpl) SetCategories(host, service string, categories []string) (err error)
- func (s *ServiceImpl) SetHost(host, name, newHost string) (err error)
- func (s ServiceImpl) SetMacro(host, service string, macro *models.Macro) (err error)
- func (s ServiceImpl) SetParam(host, service, name, value string) (err error)
- func (s ServiceImpl) SetServiceGroups(host, service string, serviceGroups []string) (err error)
- func (s ServiceImpl) SetTraps(host, service string, traps []string) (err error)
- type ServiceTemplateAPI
- type ServiceTemplateImpl
- func (s ServiceTemplateImpl) Add(host, name, template string) (err error)
- func (s ServiceTemplateImpl) Delete(host, name string) (err error)
- func (s ServiceTemplateImpl) DeleteCategories(host, service string, categories []string) (err error)
- func (s ServiceTemplateImpl) DeleteMacro(host, service, name string) (err error)
- func (s ServiceTemplateImpl) DeleteServiceGroups(host, service string, serviceGroups []string) (err error)
- func (s ServiceTemplateImpl) DeleteTraps(host, service string, traps []string) (err error)
- func (s *ServiceTemplateImpl) Get(host, name string) (service *models.ServiceTemplateGet, err error)
- func (s ServiceTemplateImpl) GetCategories(host, service string) (categories []string, err error)
- func (s ServiceTemplateImpl) GetMacros(host, service string) (macros []*models.Macro, err error)
- func (s ServiceTemplateImpl) GetParam(host, service string, params []string) (values map[string]string, err error)
- func (s ServiceTemplateImpl) GetServiceGroups(host, service string) (serviceGroups []string, err error)
- func (s ServiceTemplateImpl) GetTraps(host, service string) (traps []string, err error)
- func (s *ServiceTemplateImpl) List() (services []*models.ServiceTemplateGet, err error)
- func (s ServiceTemplateImpl) SetCategories(host, service string, categories []string) (err error)
- func (s ServiceTemplateImpl) SetMacro(host, service string, macro *models.Macro) (err error)
- func (s ServiceTemplateImpl) SetParam(host, service, name, value string) (err error)
- func (s ServiceTemplateImpl) SetServiceGroups(host, service string, serviceGroups []string) (err error)
- func (s ServiceTemplateImpl) SetTraps(host, service string, traps []string) (err error)
Constants ¶
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) }
type APIImpl ¶
type APIImpl struct {
// contains filtered or unexported fields
}
APIImpl implement the API interface
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 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 ¶
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) DeleteCategories ¶
Delete categories permit to delete categories on service
func (ServiceImpl) DeleteMacro ¶
DeleteMacro permit to remove macro on service
func (ServiceImpl) DeleteServiceGroups ¶
DeleteServiceGroups permit to delete service groups on service
func (ServiceImpl) DeleteTraps ¶
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 ¶
GetCategories permit to get all categories 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 ¶
GetServiceGroups permit to get all service groups on service
func (*ServiceImpl) List ¶
func (s *ServiceImpl) List() (services []*models.ServiceGet, err error)
List permit to get all services
func (ServiceImpl) SetCategories ¶
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) SetServiceGroups ¶
SetServiceGroups permit to set service groups 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) DeleteCategories ¶
func (s ServiceTemplateImpl) DeleteCategories(host, service string, categories []string) (err error)
Delete categories permit to delete categories on service
func (ServiceTemplateImpl) DeleteMacro ¶
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 ¶
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 ¶
GetCategories permit to get all categories 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) List ¶
func (s *ServiceTemplateImpl) List() (services []*models.ServiceTemplateGet, err error)
List permit to get all service templates
func (ServiceTemplateImpl) SetCategories ¶
SetCategories permit to set categories on service
func (ServiceTemplateImpl) SetServiceGroups ¶
func (s ServiceTemplateImpl) SetServiceGroups(host, service string, serviceGroups []string) (err error)
SetServiceGroups permit to set service groups on service