Documentation
¶
Index ¶
- Constants
- type ApiClient
- func (a *ApiClient) CheckConnectivity() error
- func (a *ApiClient) ConvertResponse(r Response, v interface{}) error
- func (a *ApiClient) Error(r Response) error
- func (a *ApiClient) ExecuteRequest(r *http.Request) ([]byte, error)
- func (a *ApiClient) NewRequest(method string, params interface{}) Request
- func (a *ApiClient) Post(body interface{}) (*Response, error)
- func (a *ApiClient) ResourceAlreadyExist(resource string, value string, err ResponseError) bool
- type ApiUser
- type AuthRequest
- type AuthService
- type GlobalMacro
- type GlobalMacroResponse
- type Host
- type HostCreateParameters
- type HostEvalType
- type HostGetParameters
- type HostGroup
- type HostGroupGetParameters
- type HostGroupId
- type HostGroupMassAddParameters
- type HostGroupMassRemoveParameters
- type HostGroupMassUpdateParameters
- type HostGroupResponse
- type HostGroupService
- func (h *HostGroupService) Create(name string) (*HostGroupResponse, error)
- func (h *HostGroupService) Delete(ids []string) (*HostGroupResponse, error)
- func (h *HostGroupService) Get(p *HostGroupGetParameters) ([]*HostGroup, error)
- func (h *HostGroupService) List() ([]*HostGroup, error)
- func (h *HostGroupService) MassAdd(p *HostGroupMassAddParameters) (*HostGroupResponse, error)
- func (h *HostGroupService) MassRemove(p *HostGroupMassRemoveParameters) (*HostGroupResponse, error)
- func (h *HostGroupService) MassUpdate(p *HostGroupMassUpdateParameters) (*HostGroupResponse, error)
- func (h *HostGroupService) Update(id string, name string) (*HostGroupResponse, error)
- type HostId
- type HostInterface
- type HostInterfaceAuthProtocol
- type HostInterfaceDetail
- type HostInterfaceGetParameters
- type HostInterfaceMain
- type HostInterfaceMassAddParameters
- type HostInterfaceMassAddResponse
- type HostInterfaceMassProperties
- type HostInterfaceMassRemoveParameters
- type HostInterfacePrivProtocol
- type HostInterfaceReplaceParameters
- type HostInterfaceResponse
- type HostInterfaceSecurityLevel
- type HostInterfaceService
- func (h *HostInterfaceService) Create(p *HostInterface) (*HostInterfaceResponse, error)
- func (h *HostInterfaceService) Delete(ids []string) (*HostInterfaceResponse, error)
- func (h *HostInterfaceService) Get(p *HostInterfaceGetParameters) ([]*HostInterface, error)
- func (h *HostInterfaceService) MassAdd(p *HostInterfaceMassAddParameters) (*HostInterfaceResponse, error)
- func (h *HostInterfaceService) MassRemove(p *HostInterfaceMassRemoveParameters) (*HostInterfaceResponse, error)
- func (h *HostInterfaceService) ReplaceHostInterfaces(p *HostInterfaceReplaceParameters) (*HostInterfaceResponse, error)
- func (h *HostInterfaceService) Update(p *HostInterfaceUpdateParameters) (*HostInterfaceResponse, error)
- type HostInterfaceType
- type HostInterfaceUpdateParameters
- type HostInterfaceVersion
- type HostInventory
- type HostInventoryMode
- type HostIpmiAuthType
- type HostIpmiPrivilege
- type HostMacro
- type HostMacroResponse
- type HostMassAddParameters
- type HostMassRemoveParameters
- type HostMassUpdateParameters
- type HostReponse
- type HostService
- func (h *HostService) Create(p *HostCreateParameters) (*HostReponse, error)
- func (h *HostService) Delete(ids []string) (*HostReponse, error)
- func (h *HostService) Get(p *HostGetParameters) ([]*Host, error)
- func (h *HostService) MassAdd(p *HostMassAddParameters) (*HostReponse, error)
- func (h *HostService) MassRemove(p *HostMassRemoveParameters) (*HostReponse, error)
- func (h *HostService) MassUpdate(p *HostMassUpdateParameters) (*HostReponse, error)
- func (h *HostService) Update(p *HostUpdateParameters) (*HostReponse, error)
- type HostStatus
- type HostTag
- type HostTags
- type HostTlsMode
- type HostUpdateParameters
- type MacroType
- type Request
- type Response
- type ResponseError
- type Template
- type TemplateCreateParameters
- type TemplateGetParameters
- type TemplateGetResponse
- type TemplateId
- type TemplateMassAddParameters
- type TemplateMassRemoveParameters
- type TemplateMassUpdateParameters
- type TemplateResponse
- type TemplateService
- func (t *TemplateService) Create(p *TemplateCreateParameters) (*TemplateResponse, error)
- func (t *TemplateService) Delete(ids []string) (*TemplateResponse, error)
- func (t *TemplateService) Get(p *TemplateGetParameters) ([]*TemplateGetResponse, error)
- func (t *TemplateService) List() ([]*TemplateGetResponse, error)
- func (t *TemplateService) MassAdd(p *TemplateMassAddParameters) (*TemplateResponse, error)
- func (t *TemplateService) MassRemove(p *TemplateMassRemoveParameters) (*TemplateResponse, error)
- func (t *TemplateService) MassUpdate(p *TemplateMassUpdateParameters) (*TemplateResponse, error)
- func (t *TemplateService) Update(p *TemplateUpdateParameters) (*TemplateResponse, error)
- type TemplateTag
- type TemplateUpdateParameters
- type UserGroup
- type UserGroupCreateParameters
- type UserGroupDebugMode
- type UserGroupGetParameters
- type UserGroupGuiAccess
- type UserGroupPermission
- type UserGroupPermissionType
- type UserGroupResponse
- type UserGroupService
- func (u *UserGroupService) Create(params *UserGroupCreateParameters) (*UserGroupResponse, error)
- func (u *UserGroupService) Delete(ids []string) (*UserGroupResponse, error)
- func (u *UserGroupService) Get(params *UserGroupGetParameters) ([]*UserGroup, error)
- func (u *UserGroupService) List() ([]*UserGroup, error)
- func (u *UserGroupService) Update(params *UserGroupUpdateParameters) (*UserGroupResponse, error)
- type UserGroupStatus
- type UserGroupTagPermission
- type UserGroupUpdateParameters
- type UserMacroGetParameters
- type UserMacroService
- func (u *UserMacroService) Create(h *HostMacro) (*HostMacroResponse, error)
- func (u *UserMacroService) CreateGlobal(g *GlobalMacro) (*GlobalMacroResponse, error)
- func (u *UserMacroService) Delete(ids []string) (*HostMacroResponse, error)
- func (u *UserMacroService) DeleteGlobal(ids []string) (*GlobalMacroResponse, error)
- func (u *UserMacroService) Get(p *UserMacroGetParameters) ([]*HostMacro, error)
- func (u *UserMacroService) GetGlobal(p *UserMacroGetParameters) ([]*GlobalMacro, error)
- func (u *UserMacroService) Update(h *HostMacro) (*HostMacroResponse, error)
- func (u *UserMacroService) UpdateGlobal(m *GlobalMacro) (*GlobalMacroResponse, error)
- type ZabbixService
Constants ¶
const ( Host_Disabled HostInventoryMode = "-1" Host_Manual HostInventoryMode = "0" Host_Automatic HostInventoryMode = "1" Host_Default HostIpmiAuthType = "-1" Host_None HostIpmiAuthType = "0" Host_MD2 HostIpmiAuthType = "1" Host_MD5 HostIpmiAuthType = "2" Host_Straight HostIpmiAuthType = "4" Host_OEM HostIpmiAuthType = "5" Host_RMCP HostIpmiAuthType = "6" Callback HostIpmiPrivilege = "1" User HostIpmiPrivilege = "2" Operator HostIpmiPrivilege = "3" Admin HostIpmiPrivilege = "4" OEM HostIpmiPrivilege = "5" Monitored HostStatus = "0" Unmonitored HostStatus = "1" NoEncryption HostTlsMode = "1" PSK HostTlsMode = "2" Certificate HostTlsMode = "4" Type HostInventory = "type" And_Or HostEvalType = "0" Or HostEvalType = "2" Contains HostTags = "0" Equals HostTags = "1" Not_like HostTags = "2" Not_equal HostTags = "3" Exists HostTags = "4" Not_exists HostTags = "5" )
const ( NotDefault HostInterfaceMain = "0" Default HostInterfaceMain = "1" Agent HostInterfaceType = "1" SNMP HostInterfaceType = "2" IPMI HostInterfaceType = "3" JMX HostInterfaceType = "4" SNMPv1 HostInterfaceVersion = "1" SNMPv2c HostInterfaceVersion = "2" SNMPv3 HostInterfaceVersion = "3" NoAuthNoPriv HostInterfaceSecurityLevel = "0" AuthNoPriv HostInterfaceSecurityLevel = "1" AuthPriv HostInterfaceSecurityLevel = "3" MD5 HostInterfaceAuthProtocol = "0" SHA1 HostInterfaceAuthProtocol = "1" SHA224 HostInterfaceAuthProtocol = "2" SHA256 HostInterfaceAuthProtocol = "3" SHA384 HostInterfaceAuthProtocol = "4" SHA512 HostInterfaceAuthProtocol = "5" DES HostInterfacePrivProtocol = "0" AES128 HostInterfacePrivProtocol = "1" AES192 HostInterfacePrivProtocol = "2" AES256 HostInterfacePrivProtocol = "3" AES192C HostInterfacePrivProtocol = "4" AES256C HostInterfacePrivProtocol = "5" )
const ( // Default UserGroupDebugDisabled UserGroupDebugMode = "0" UserGroupDebugEnabled UserGroupDebugMode = "1" // Default UserGroupSystemDefault UserGroupGuiAccess = "0" UserGroupInternal UserGroupGuiAccess = "1" UserGroupLDAP UserGroupGuiAccess = "2" UserGroupDisable UserGroupGuiAccess = "3" // Default UserGroupStatusEnabled UserGroupStatus = "0" UserGroupStatusDisabled UserGroupStatus = "1" UserGroupAccessDenied UserGroupPermissionType = "0" UserGroupAccessReadOnly UserGroupPermissionType = "2" UserGroupAccessReadWrite UserGroupPermissionType = "3" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApiClient ¶
type ApiClient struct { // URL of the Zabbix API // Format : http[s]://<zabbix-ip-or-dns>[/zabbix]/api_jsonrpc.php // [] are optional fields // <> are required fields Url string // API token use to authenticate when calling the differents methods Token string // contains filtered or unexported fields }
ApiClient is the default client structure to interact with the Zabbix API
func (*ApiClient) CheckConnectivity ¶ added in v0.0.2
CheckConnectivity is used to validate connectivity against the current ApiClient Zabbix server. If the connection cannot be established, an error is returned.
func (*ApiClient) ConvertResponse ¶
ConvertResponse convert the Result property in the given Response to the given 'v' type. 'v' must be a pointer.
func (*ApiClient) Error ¶
Error return a more user-friendly error using the Error property in the given Response.
func (*ApiClient) ExecuteRequest ¶
ExecuteRequest execute the given Request and return an []byte or an error
func (*ApiClient) NewRequest ¶
NewRequest build a new API Request with the given method and params
func (*ApiClient) Post ¶
Post is a method that accept a body an wrap multiple methods.
1. Convert the body to a JSON encoding.
2. Generate a new HTTP POST Request with the ApiClient.Url property and the enconded JSON body.
3. Set the 'Content-type' header to 'application/json-rpc'.
4. Execute the HTTP Request.
5. Convert the HTTP response to a API Response object.
Return a Response object or an error that occured during the 5 previous steps
func (*ApiClient) ResourceAlreadyExist ¶
func (a *ApiClient) ResourceAlreadyExist(resource string, value string, err ResponseError) bool
ResourceAlreadyExist check it the Data field in the given ResponseError indicate a 'resource already exists' type error.
type ApiUser ¶
ApiUser defined the informations needed to authenticate against the Zabbix API and retrieve a API Token.
type AuthRequest ¶
type AuthRequest struct { Jsonrpc string `json:"jsonrpc"` Method string `json:"method"` Params map[string]string `json:"params"` Id int `json:"id"` Auth *string `json:"auth"` }
Request define the body format to interact with the API. The 'auth.login' method accept a different format than the other
type AuthService ¶
type AuthService struct { Client *ApiClient // Required only if you intend to use ZabbixService Authenticate method. User *ApiUser }
AuthService create a new service to access authentification related methods and functions.
func (*AuthService) GetCredentials ¶
func (s *AuthService) GetCredentials(user string, password string) (*Response, error)
GetCredentials execute an AuthRequest using the given user[name] // password and return a Response.
func (*AuthService) NewAuthRequest ¶
func (s *AuthService) NewAuthRequest(user string, password string) AuthRequest
NewAuthRequest build a new API Request (for authentification only)
type GlobalMacro ¶
type GlobalMacro struct { // ReadOnly Id string `json:"globalmacroid,omitempty"` Macro string `json:"macro"` Value string `json:"value"` Type MacroType `json:"type,omitempty"` Description string `json:"description,omitempty"` }
GlobalMacro properties. Some properties are read-only, which means they are only accessible after creation and should not be passed as arguments in other methods.
func (*GlobalMacro) ValidateMacro ¶
func (g *GlobalMacro) ValidateMacro() error
ValidateMacro is used to validate GlobalMacro format compliance.
type GlobalMacroResponse ¶
type GlobalMacroResponse struct {
Globalmacroids []string `json:"globalmacroids"`
}
GlobalMacroResponse define the server response format for GlobalMacro methods.
type Host ¶
type Host struct { // ReadOnly Hostid string `json:"hostid"` Host string `json:"host"` Name string `json:"name"` Description string `json:"description"` // ReadOnly Flags string `json:"flags"` Inventory_mode HostInventoryMode `json:"inventory_mode"` Ipmi_authtype HostIpmiAuthType `json:"ipmi_authtype"` Ipmi_password string `json:"ipmi_password"` Ipmi_privilege HostIpmiPrivilege `json:"ipmi_privilege"` Ipmi_username string `json:"ipmi_username"` // ReadOnly Maintenance_from string `json:"maintenance_from"` // ReadOnly Maintenance_status string `json:"maintenance_status"` // ReadOnly Maintenance_type string `json:"maintenance_type"` // ReadOnly Maintenanceid string `json:"maintenanceid"` Proxy_hostid string `json:"proxy_hostid"` Status HostStatus `json:"status"` Tls_connect HostTlsMode `json:"tls_connect"` Tls_accept HostTlsMode `json:"tls_accept"` Tls_issuer string `json:"tls_issuer"` Tls_subject string `json:"tls_subject"` Tls_psk_identity string `json:"tls_psk_identity"` Tls_psk string `json:"tls_psk"` }
Host properties. Some properties are read-only, which means they are only accessible after creation and should not be passed as arguments in other methods.
type HostCreateParameters ¶
type HostCreateParameters struct { Host string `json:"host"` Groups []*HostGroupId `json:"groups"` Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Inventory_mode HostInventoryMode `json:"inventory_mode,omitempty"` Ipmi_authtype HostIpmiAuthType `json:"ipmi_authtype,omitempty"` Ipmi_password string `json:"ipmi_password,omitempty"` Ipmi_privilege HostIpmiPrivilege `json:"ipmi_privilege,omitempty"` Ipmi_username string `json:"ipmi_username,omitempty"` Proxy_hostid string `json:"proxy_hostid,omitempty"` Status HostStatus `json:"status,omitempty"` Tls_connect HostTlsMode `json:"tls_connect,omitempty"` Tls_accept HostTlsMode `json:"tls_accept,omitempty"` Tls_issuer string `json:"tls_issuer,omitempty"` Tls_subject string `json:"tls_subject,omitempty"` Tls_psk_identity string `json:"tls_psk_identity,omitempty"` Tls_psk string `json:"tls_psk,omitempty"` Interfaces []*HostInterface `json:"interfaces,omitempty"` Tags []*HostTag `json:"tags,omitempty"` Templates []*TemplateId `json:"templates,omitempty"` Macros []*HostMacro `json:"macros,omitempty"` Inventory map[HostInventory]string `json:"invetory,omitempty"` }
HostCreateParameters define the properties needed to create a new Host Properties using the 'omitempty' json parameters are optional
type HostEvalType ¶
type HostEvalType string
HostEvalType define the available evaluation operators.
type HostGetParameters ¶
type HostGetParameters struct { Groupids []string `json:"groupids,omitempty"` Dserviceids []string `json:"dserviceids,omitempty"` Graphids []string `json:"graphids,omitempty"` Hostids []string `json:"hostids,omitempty"` Httptestids []string `json:"httptestids,omitempty"` Interfaceids []string `json:"interfaceids,omitempty"` Itemids []string `json:"itemids,omitempty"` Maintenanceids []string `json:"maintenanceids,omitempty"` Monitored_hosts bool `json:"monitored_hosts,omitempty"` Proxy_hosts bool `json:"proxy_hosts,omitempty"` Proxyids []string `json:"proxyids,omitempty"` Templated_hosts bool `json:"templated_hosts,omitempty"` Templateids []string `json:"templateids,omitempty"` Triggerids []string `json:"triggerids,omitempty"` With_items bool `json:"with_items,omitempty"` With_item_prototypes bool `json:"with_item_prototypes,omitempty"` With_simple_graph_item_prototypes bool `json:"with_simple_graph_item_prototypes,omitempty"` With_graphs bool `json:"with_graphs,omitempty"` With_graph_prototypes bool `json:"with_graph_prototypes,omitempty"` With_httptests bool `json:"with_httptests,omitempty"` With_monitored_httptests bool `json:"with_monitored_httptests,omitempty"` With_monitored_items bool `json:"with_monitored_items,omitempty"` With_simple_graph_items bool `json:"with_simple_graph_items,omitempty"` With_triggers bool `json:"with_triggers,omitempty"` WithProblemsSuppressed bool `json:"withProblemsSuppressed,omitempty"` Evaltype HostEvalType `json:"evaltype,omitempty"` Severities []string `json:"severities,omitempty"` Tags HostTags `json:"tags,omitempty"` InheritedTags bool `json:"inheritedTags,omitempty"` SelectDiscoveries interface{} `json:"selectDiscoveries,omitempty"` SelectDiscoveryRule interface{} `json:"selectDiscoveryRule,omitempty"` SelectGraphs interface{} `json:"selectGraphs,omitempty"` SelectGroups interface{} `json:"selectGroups,omitempty"` SelectHostDiscovery interface{} `json:"selectHostDiscovery,omitempty"` SelectHttpTests interface{} `json:"selectHttpTests,omitempty"` SelectInterfaces interface{} `json:"selectInterfaces,omitempty"` SelectInventory interface{} `json:"selectInventory,omitempty"` SelectItems interface{} `json:"selectItems,omitempty"` SelectMacros interface{} `json:"selectMacros,omitempty"` SelectParentTemplates interface{} `json:"selectParentTemplates,omitempty"` SelectDashboards interface{} `json:"selectDashboards,omitempty"` SelectTags interface{} `json:"selectTags,omitempty"` SelectInheritedTags interface{} `json:"selectInheritedTags,omitempty"` SelectTriggers interface{} `json:"selectTriggers,omitempty"` SelectValueMaps interface{} `json:"selectValueMaps,omitempty"` Filter interface{} `json:"filter,omitempty"` LimitSelects int `json:"limitSelects,omitempty"` Search interface{} `json:"search,omitempty"` SearchInventory interface{} `json:"searchInventory,omitempty"` Sortfield []string `json:"sortfield,omitempty"` CountOutput bool `json:"countOutput,omitempty"` Editable bool `json:"editable,omitempty"` ExcludeSearch bool `json:"excludeSearch,omitempty"` Limit int `json:"limit,omitempty"` Output interface{} `json:"output,omitempty"` Preservekeys bool `json:"preservekeys,omitempty"` SearchByAny bool `json:"searchByAny,omitempty"` SearchWildcardsEnabled bool `json:"searchWildcardsEnabled,omitempty"` Sortorder []string `json:"sortorder,omitempty"` StartSearch bool `json:"startSearch,omitempty"` }
HostGetParameters define the properties used to search Host(s) Properties using the 'omitempty' json parameters are optional
type HostGroup ¶
type HostGroup struct { Id string `json:"groupid"` Name string `json:"name"` // ReadOnly Flags string `json:"flags"` // ReadOnly Internal string `json:"internal"` // ReadOnly Uuid string `json:"uuid"` }
HostGroup properties.
type HostGroupGetParameters ¶
type HostGroupGetParameters struct { Graphids []string `json:"graphids,omitempty"` Groupids []string `json:"groupids,omitempty"` Hostids []string `json:"hostids,omitempty"` Maintenanceids []string `json:"maintenanceids,omitempty"` Monitored_hosts bool `json:"monitored_hosts,omitempty"` Real_hosts bool `json:"real_hosts,omitempty"` Templated_hosts bool `json:"templated_hosts,omitempty"` Templateids []string `json:"templateids,omitempty"` Triggerids []string `json:"triggerids,omitempty"` With_graphs bool `json:"with_graphs,omitempty"` With_graph_prototypes bool `json:"with_graph_prototypes,omitempty"` With_hosts_and_templates bool `json:"with_hosts_and_templates,omitempty"` With_httptests bool `json:"with_httptests,omitempty"` With_item_prototypes bool `json:"with_item_prototypes,omitempty"` With_simple_graph_item_prototypes bool `json:"with_simple_graph_item_prototypes,omitempty"` With_monitored_httptests bool `json:"with_monitored_httptests,omitempty"` With_monitored_items bool `json:"with_monitored_items,omitempty"` With_monitored_triggers bool `json:"with_monitored_triggers,omitempty"` With_simple_graph_items bool `json:"with_simple_graph_items,omitempty"` With_triggers bool `json:"with_triggers,omitempty"` SelectDiscoveryRule interface{} `json:"selectDiscoveryRule,omitempty"` SelectGroupDiscovery interface{} `json:"selectGroupDiscovery,omitempty"` SelectHosts interface{} `json:"selectHosts,omitempty"` SelectTemplates interface{} `json:"selectTemplates,omitempty"` LimitSelects int `json:"limitSelects,omitempty"` Sortfield []string `json:"sortfield,omitempty"` CountOutput bool `json:"countOutput,omitempty"` Editable bool `json:"editable,omitempty"` ExcludeSearch bool `json:"excludeSearch,omitempty"` Filter interface{} `json:"filter,omitempty"` Limit int `json:"limit,omitempty"` Output interface{} `json:"output,omitempty"` Preservekeys bool `json:"preservekeys,omitempty"` Search interface{} `json:"search,omitempty"` SearchByAny bool `json:"searchByAny,omitempty"` SearchWildcardsEnabled bool `json:"searchWildcardsEnabled,omitempty"` Sortorder []string `json:"sortorder,omitempty"` StartSearch bool `json:"startSearch,omitempty"` }
HostGroupGetParameters define the properties used to search HostGroup(s). Properties using the 'omitempty' json parameters are optional
type HostGroupId ¶
type HostGroupId struct {
Groupid string `json:"groupid"`
}
HostGroupId define a representation for certain methods that only requires the 'groupid' property.
type HostGroupMassAddParameters ¶
type HostGroupMassAddParameters struct { Groups []*HostGroupId `json:"groups"` Hosts []*HostId `json:"hosts,omitempty"` Templates []*TemplateId `json:"templates,omitempty"` }
HostGroupMassAddParameters define the properties used for the MassAdd method. Properties using the 'omitempty' json parameters are optional.
type HostGroupMassRemoveParameters ¶
type HostGroupMassRemoveParameters struct { GroupsIds []string `json:"groupids"` HostIds []string `json:"hostids,omitempty"` TemplateIds []string `json:"templateids,omitempty"` }
HostGroupMassRemoveParameters define the properties used for the MassRemove method. Properties using the 'omitempty' json parameters are optional.
type HostGroupMassUpdateParameters ¶
type HostGroupMassUpdateParameters struct { Groups []*HostGroupId `json:"groups"` Hosts []*HostId `json:"hosts"` Templates []*TemplateId `json:"templates"` }
HostGroupMassUpdateParameters define the properties used for the MassUpdate method. Properties using the 'omitempty' json parameters are optional.
type HostGroupResponse ¶
type HostGroupResponse struct {
Groupids []string `json:"groupids"`
}
HostGroupResponse define the server response format for HostGroup methods.
type HostGroupService ¶
type HostGroupService struct {
Client *ApiClient
}
HostGroupService create a new service to access host related methods and functions.
func (*HostGroupService) Create ¶
func (h *HostGroupService) Create(name string) (*HostGroupResponse, error)
Create is used to create a new HostGroup.
func (*HostGroupService) Delete ¶
func (h *HostGroupService) Delete(ids []string) (*HostGroupResponse, error)
Delete is used to delete one or multiples HostGroups.
func (*HostGroupService) Get ¶
func (h *HostGroupService) Get(p *HostGroupGetParameters) ([]*HostGroup, error)
Get is used to retrieve one or multiples HostGroups matching the given criteria(s).
func (*HostGroupService) List ¶
func (h *HostGroupService) List() ([]*HostGroup, error)
List is used to retrieve all HostGroups for the server.
func (*HostGroupService) MassAdd ¶
func (h *HostGroupService) MassAdd(p *HostGroupMassAddParameters) (*HostGroupResponse, error)
MassAdd is used to massively add properties to existing HostGroups.
func (*HostGroupService) MassRemove ¶
func (h *HostGroupService) MassRemove(p *HostGroupMassRemoveParameters) (*HostGroupResponse, error)
MassRemove is used to massively remove properties from existing HostGroups.
func (*HostGroupService) MassUpdate ¶
func (h *HostGroupService) MassUpdate(p *HostGroupMassUpdateParameters) (*HostGroupResponse, error)
MassUpdate is used to massively update or overwrite properties from existing HostGroups.
func (*HostGroupService) Update ¶
func (h *HostGroupService) Update(id string, name string) (*HostGroupResponse, error)
Update is used to update the name of an existing HostGroup.
type HostId ¶
type HostId struct {
Hostid string `json:"hostid"`
}
HostId define a representation for certain methods that only requires the 'hostid' property.
type HostInterface ¶
type HostInterface struct { Hostid string `json:"hostid,omitempty"` Ip string `json:"ip"` Dns string `json:"dns"` Main HostInterfaceMain `json:"main"` Port string `json:"port"` Type HostInterfaceType `json:"type"` Useip string `json:"useip"` Details *HostInterfaceDetail `json:"details,omitempty"` // ReadOnly Available string `json:"available,omitempty"` // ReadOnly Disable_until string `json:"disable_until,omitempty"` // ReadOnly Error string `json:"error,omitempty"` // ReadOnly Errors_from string `json:"errors_from,omitempty"` // ReadOnly Interfaceid string `json:"interfaceid,omitempty"` }
HostInterface properties. Some properties are read-only, which means they are only accessible after creation and should not be passed as arguments in other methods.
func (*HostInterface) ValidateSNMP ¶
func (h *HostInterface) ValidateSNMP() error
ValidateSNMP help to verify that the 'Details' property is set when configuring SNMP interface.
type HostInterfaceAuthProtocol ¶
type HostInterfaceAuthProtocol string
HostInterfaceAuthProtocol define the available SNMPv3 authentification protocols.
type HostInterfaceDetail ¶
type HostInterfaceDetail struct { Version HostInterfaceVersion `json:"version"` // Whether to use bulk SNMP requests. // // 0 = Don't use bulk requests. // // 1 = Use bulk requests (default). Bulk string `json:"bulk,omitempty"` Community string `json:"community,omitempty"` Securityname string `json:"securityname,omitempty"` Securitylevel HostInterfaceSecurityLevel `json:"securitylevel,omitempty"` Authpassphrase string `json:"authpassphrase,omitempty"` Privpassphrase string `json:"privpassphrase,omitempty"` Authprotocol HostInterfaceAuthProtocol `json:"authprotocol,omitempty"` Privprotocol HostInterfacePrivProtocol `json:"privprotocol,omitempty"` Contextname string `json:"contextname,omitempty"` }
HostInterface details properties for SNMP interface. Properties using the 'omitempty' json parameters are optional
type HostInterfaceGetParameters ¶
type HostInterfaceGetParameters struct { Hostids []string `json:"hostids,omitempty"` Interfaceids []string `json:"interfaceids,omitempty"` Itemids []string `json:"itemids,omitempty"` Triggerids []string `json:"triggerids,omitempty"` SelectItems interface{} `json:"selectItems,omitempty"` SelectHosts interface{} `json:"selectHosts,omitempty"` LimitSelects int `json:"limitSelects,omitempty"` Sortfield []string `json:"sortfield,omitempty"` CountOutput bool `json:"countOutput,omitempty"` Editable bool `json:"editable,omitempty"` ExcludeSearch bool `json:"excludeSearch,omitempty"` Filter interface{} `json:"filter,omitempty"` Limit int `json:"limit,omitempty"` Output interface{} `json:"output,omitempty"` Preservekeys bool `json:"preservekeys,omitempty"` Search interface{} `json:"search,omitempty"` SearchByAny bool `json:"searchByAny,omitempty"` SearchWildcardsEnabled bool `json:"searchWildcardsEnabled,omitempty"` Sortorder []string `json:"sortorder,omitempty"` StartSearch bool `json:"startSearch,omitempty"` }
HostInterfaceGetParameters define the properties used to search HostInterface(s) Properties using the 'omitempty' json parameters are optional
type HostInterfaceMain ¶
type HostInterfaceMain string
HostInterfaceMain define if an interface should be used as default or not.
type HostInterfaceMassAddParameters ¶
type HostInterfaceMassAddParameters struct { Hosts []*HostId `json:"hosts"` Interfaces []*HostInterfaceMassProperties `json:"interfaces"` }
HostInterfaceMassAddParameters define the properties used for the MassAdd method.
type HostInterfaceMassAddResponse ¶
type HostInterfaceMassAddResponse struct {
Response *HostInterfaceResponse `json:"interfaceids"`
}
HostInterfaceMassAddResponse define the server response format for the MassAdd method.
type HostInterfaceMassProperties ¶
type HostInterfaceMassProperties struct { Ip string `json:"ip"` Dns string `json:"dns"` Main HostInterfaceMain `json:"main"` Port string `json:"port"` Type HostInterfaceType `json:"type"` Useip string `json:"useip"` Details *HostInterfaceDetail `json:"details,omitempty"` }
HostInterfaceMassProperties define the HostInterface properties used for the Mass method. Properties using the 'omitempty' json parameters are optional.
type HostInterfaceMassRemoveParameters ¶
type HostInterfaceMassRemoveParameters struct { HostIds []string `json:"hostids"` Interfaces []*HostInterfaceMassProperties `json:"interfaces"` }
HostInterfaceMassRemoveParameters define the properties used for the MassRemove method.
type HostInterfacePrivProtocol ¶
type HostInterfacePrivProtocol string
HostInterfacePrivProtocol define the available SNMPv3 encryption (priv) protocols.
type HostInterfaceReplaceParameters ¶
type HostInterfaceReplaceParameters struct { Host string `json:"hostid"` Interfaces []*HostInterfaceMassProperties `json:"interfaces"` }
HostInterfaceReplaceParameters define the properties used for the ReplaceHostInterfaces method.
type HostInterfaceResponse ¶
HostInterfaceResponse define the server response format for HostInterface methods.
type HostInterfaceSecurityLevel ¶
type HostInterfaceSecurityLevel string
HostInterfaceSecurityLevel define the available SNMPv3 security levels.
type HostInterfaceService ¶
type HostInterfaceService struct {
Client *ApiClient
}
HostInterfaceService create a new service to access hostinterface related methods and functions.
func (*HostInterfaceService) Create ¶
func (h *HostInterfaceService) Create(p *HostInterface) (*HostInterfaceResponse, error)
Create is used to create a new HostInterface.
func (*HostInterfaceService) Delete ¶
func (h *HostInterfaceService) Delete(ids []string) (*HostInterfaceResponse, error)
Delete is used to delete one or multiples HostInterfaces.
func (*HostInterfaceService) Get ¶
func (h *HostInterfaceService) Get(p *HostInterfaceGetParameters) ([]*HostInterface, error)
Get is used to retrieve one or multiples HostInterfaces matching the given criteria(s).
func (*HostInterfaceService) MassAdd ¶
func (h *HostInterfaceService) MassAdd(p *HostInterfaceMassAddParameters) (*HostInterfaceResponse, error)
MassAdd is used to massively add HostInterfaces to existing Hosts.
func (*HostInterfaceService) MassRemove ¶
func (h *HostInterfaceService) MassRemove(p *HostInterfaceMassRemoveParameters) (*HostInterfaceResponse, error)
MassRemove is used to massively remove HostInterfaces from existing Hosts.
func (*HostInterfaceService) ReplaceHostInterfaces ¶
func (h *HostInterfaceService) ReplaceHostInterfaces(p *HostInterfaceReplaceParameters) (*HostInterfaceResponse, error)
ReplaceHostInterfaces is used to massively replace HostInterfaces from existing Hosts.
func (*HostInterfaceService) Update ¶
func (h *HostInterfaceService) Update(p *HostInterfaceUpdateParameters) (*HostInterfaceResponse, error)
Update is used to update or overwrite HostInterfaces from an existing Hosts.
type HostInterfaceType ¶
type HostInterfaceType string
HostInterfaceType define the available types of interface.
type HostInterfaceUpdateParameters ¶
type HostInterfaceUpdateParameters struct { Interfaceid string `json:"interfaceid"` Ip string `json:"ip,omitempty"` Dns string `json:"dns,omitempty"` Main HostInterfaceMain `json:"main,omitempty"` Port string `json:"port,omitempty"` Type HostInterfaceType `json:"type,omitempty"` Useip string `json:"useip,omitempty"` Details *HostInterfaceDetail `json:"details,omitempty"` }
HostInterfaceUpdateParameters define the properties needed for the Update method. Properties using the 'omitempty' json parameters are optional.
type HostInterfaceVersion ¶
type HostInterfaceVersion string
HostInterfaceVersion define the available SNMP versions.
type HostInventoryMode ¶
type HostInventoryMode string
HostInventoryMode define the available inventory modes.
type HostIpmiAuthType ¶
type HostIpmiAuthType string
HostIpmiAuthType define the available ipmi auth modes.
type HostIpmiPrivilege ¶
type HostIpmiPrivilege string
HostIpmiPrivilege define the available ipmi privilege modes.
type HostMacro ¶
type HostMacro struct { // ReadOnly Id string `json:"hostmacroid,omitempty"` Hostid string `json:"hostid,omitempty"` Macro string `json:"macro"` Value string `json:"value"` Type MacroType `json:"type,omitempty"` Description string `json:"description,omitempty"` }
HostMacro properties. Some properties are read-only, which means they are only accessible after creation and should not be passed as arguments in other methods.
func (*HostMacro) ValidateMacro ¶
ValidateMacro is used to validate HostMacro format compliance.
type HostMacroResponse ¶
type HostMacroResponse struct {
Hostmacroids []string `json:"hostmacroids"`
}
HostMacroResponse define the server response format for HostMacro methods.
type HostMassAddParameters ¶
type HostMassAddParameters struct { Hosts []*HostId `json:"hosts"` Groups []*HostGroupId `json:"groups,omitempty"` Interfaces []*HostInterface `json:"interfaces,omitempty"` Macros []*HostMacro `json:"macros,omitempty"` Templates []*TemplateId `json:"templates,omitempty"` }
HostMassAddParameters define the properties used for the MassAdd method. Properties using the 'omitempty' json parameters are optional.
type HostMassRemoveParameters ¶
type HostMassRemoveParameters struct { HostIds []string `json:"hostids"` GroupIds []string `json:"groupids,omitempty"` Interfaces []*HostInterface `json:"interfaces,omitempty"` Macros []string `json:"macros,omitempty"` TemplateIds []string `json:"templateids,omitempty"` TemplateIdsClear []string `json:"templateids_clear,omitempty"` }
HostMassRemoveParameters define the properties used for the MassRemove method. Properties using the 'omitempty' json parameters are optional.
type HostMassUpdateParameters ¶
type HostMassUpdateParameters struct { Hosts []*HostId `json:"hosts"` Host string `json:"host,omitempty"` Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Inventory_mode HostInventoryMode `json:"inventory_mode,omitempty"` Ipmi_authtype HostIpmiAuthType `json:"ipmi_authtype,omitempty"` Ipmi_password string `json:"ipmi_password,omitempty"` Ipmi_privilege HostIpmiPrivilege `json:"ipmi_privilege,omitempty"` Ipmi_username string `json:"ipmi_username,omitempty"` Proxy_hostid string `json:"proxy_hostid,omitempty"` Status HostStatus `json:"status,omitempty"` Tls_connect HostTlsMode `json:"tls_connect,omitempty"` Tls_accept HostTlsMode `json:"tls_accept,omitempty"` Tls_issuer string `json:"tls_issuer,omitempty"` Tls_subject string `json:"tls_subject,omitempty"` Tls_psk_identity string `json:"tls_psk_identity,omitempty"` Tls_psk string `json:"tls_psk,omitempty"` Groups []*HostGroupId `json:"groups,omitempty"` Interfaces []*HostInterface `json:"interfaces,omitempty"` Inventory map[HostInventory]string `json:"inventory,omitempty"` Macros []string `json:"macros,omitempty"` Templates []*TemplateId `json:"templates,omitempty"` TemplatesClear []*TemplateId `json:"templates_clear,omitempty"` }
HostMassUpdateParameters define the properties used for the MassUpdate method. Properties using the 'omitempty' json parameters are optional.
type HostReponse ¶
type HostReponse struct {
HostIds []string `json:"hostids"`
}
HostReponse define the server response format for Host methods.
type HostService ¶
type HostService struct {
Client *ApiClient
}
HostService create a new service to access host related methods and functions.
func (*HostService) Create ¶
func (h *HostService) Create(p *HostCreateParameters) (*HostReponse, error)
Create is used to create a new Host.
func (*HostService) Delete ¶
func (h *HostService) Delete(ids []string) (*HostReponse, error)
Delete is used to delete one or multiples Hosts.
func (*HostService) Get ¶
func (h *HostService) Get(p *HostGetParameters) ([]*Host, error)
Get is used to retrieve one or multiples Hosts matching the given criteria(s).
func (*HostService) MassAdd ¶
func (h *HostService) MassAdd(p *HostMassAddParameters) (*HostReponse, error)
MassAdd is used to massively add properties to existing Hosts.
func (*HostService) MassRemove ¶
func (h *HostService) MassRemove(p *HostMassRemoveParameters) (*HostReponse, error)
MassRemove is used to massively remove properties from existing Hosts.
func (*HostService) MassUpdate ¶
func (h *HostService) MassUpdate(p *HostMassUpdateParameters) (*HostReponse, error)
MassUpdate is used to massively update or overwrite properties from existing Hosts.
func (*HostService) Update ¶
func (h *HostService) Update(p *HostUpdateParameters) (*HostReponse, error)
Update is used to update or overwrite properties from an existing Host.
type HostTags ¶
type HostTags string
HostTags define the available evaluation operators when searching hosts with tags.
type HostUpdateParameters ¶
type HostUpdateParameters struct { Hostid string `json:"hostid"` Host string `json:"host,omitempty"` Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Inventory_mode HostInventoryMode `json:"inventory_mode,omitempty"` Ipmi_authtype HostIpmiAuthType `json:"ipmi_authtype,omitempty"` Ipmi_password string `json:"ipmi_password,omitempty"` Ipmi_privilege HostIpmiPrivilege `json:"ipmi_privilege,omitempty"` Ipmi_username string `json:"ipmi_username,omitempty"` Proxy_hostid string `json:"proxy_hostid,omitempty"` Status HostStatus `json:"status,omitempty"` Tls_connect HostTlsMode `json:"tls_connect,omitempty"` Tls_accept HostTlsMode `json:"tls_accept,omitempty"` Tls_issuer string `json:"tls_issuer,omitempty"` Tls_subject string `json:"tls_subject,omitempty"` Tls_psk_identity string `json:"tls_psk_identity,omitempty"` Tls_psk string `json:"tls_psk,omitempty"` Groups []*HostGroupId `json:"groups,omitempty"` Interfaces []*HostInterface `json:"interfaces,omitempty"` Tags []*HostTag `json:"tags,omitempty"` Inventory map[HostInventory]string `json:"inventory,omitempty"` Macros []string `json:"macros,omitempty"` Templates []*TemplateId `json:"templates,omitempty"` TemplatesClear []*TemplateId `json:"templates_clear,omitempty"` }
HostUpdateParameters define the properties needed for the Update method. Properties using the 'omitempty' json parameters are optional.
type Request ¶
type Request struct { // Jsonrpc defined the version used of the json-rpc implementation // By default "2.0" Jsonrpc string `json:"jsonrpc"` // Method is the name of the method called Method string `json:"method"` // Params contains the differents parameters to pass to the method Params interface{} `json:"params"` // Id is an arbitrary identifier of the request Id int `json:"id"` // Auth is the API token used to authenticate Auth string `json:"auth"` }
Request define the default body format to interact with the API
type Response ¶
type Response struct { // Jsonrpc defined the version used of the json-rpc implementation // By default "2.0" Jsonrpc string `json:"jsonrpc"` // Result is the data returned by the method called // Since the response differs from one method to another, // the result is returned raw ([]byte) and will need more processing Result json.RawMessage `json:"result"` // Error contains the more details about the server side error Error ResponseError `json:"error,omitempty"` // Id is an identifier for the corresponding request. Id int `json:"id"` }
Response define the response format returned by the API
type ResponseError ¶
type ResponseError struct { Code int `json:"code"` Message string `json:"message"` Data string `json:"data"` }
ResponseError define the error format returned in the Response body when a server error occured
type Template ¶
type Template struct { // ReadOnly Id string `json:"templateid"` Host string `json:"host"` Name string `json:"name"` Description string `json:"description"` // ReadOnly Uuid string `json:"uuid"` }
Template properties. Some properties are read-only, which means they are only accessible after creation and should not be passed as arguments in other methods.
type TemplateCreateParameters ¶
type TemplateCreateParameters struct { Host string `json:"host"` Groups []*HostGroupId `json:"groups"` Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Tags []*TemplateTag `json:"tags,omitempty"` Templates []*TemplateId `json:"templates,omitempty"` Macros []*HostMacro `json:"macros,omitempty"` }
TemplateCreateParameters define the properties needed to create a new Template Properties using the 'omitempty' json parameters are optional
type TemplateGetParameters ¶
type TemplateGetParameters struct { Templateids []string `json:"templateids,omitempty"` Groupids []string `json:"groupids,omitempty"` ParentTemplateids []string `json:"parentTemplateids,omitempty"` Hostids []string `json:"hostids,omitempty"` Graphids []string `json:"graphids,omitempty"` Itemids []string `json:"itemids,omitempty"` Triggerids []string `json:"triggerids,omitempty"` With_items bool `json:"with_items,omitempty"` With_triggers bool `json:"with_triggers,omitempty"` With_graphs bool `json:"with_graphs,omitempty"` With_httptests bool `json:"with_httptests,omitempty"` Evaltype string `json:"evaltype,omitempty"` Tags []string `json:"tags,omitempty"` SelectGroups interface{} `json:"selectGroups,omitempty"` SelectTags interface{} `json:"selectTags,omitempty"` SelectHosts interface{} `json:"selectHosts,omitempty"` SelectTemplates interface{} `json:"selectTemplates,omitempty"` SelectParentTemplates interface{} `json:"selectParentTemplates,omitempty"` SelectHttpTests interface{} `json:"selectHttpTests,omitempty"` SelectItems interface{} `json:"selectItems,omitempty"` SelectDiscoveries interface{} `json:"selectDiscoveries,omitempty"` SelectTriggers interface{} `json:"selectTriggers,omitempty"` SelectGraphs interface{} `json:"selectGraphs,omitempty"` SelectMacros interface{} `json:"selectMacros,omitempty"` SelectDashboards interface{} `json:"selectDashboards,omitempty"` SelectValueMaps interface{} `json:"selectValueMaps,omitempty"` LimitSelects int `json:"limitSelects,omitempty"` Sortfield []string `json:"sortfield,omitempty"` CountOutput bool `json:"countOutput,omitempty"` Editable bool `json:"editable,omitempty"` ExcludeSearch bool `json:"excludeSearch,omitempty"` Filter interface{} `json:"filter,omitempty"` Limit int `json:"limit,omitempty"` Output interface{} `json:"output,omitempty"` Preservekeys bool `json:"preservekeys,omitempty"` Search interface{} `json:"search,omitempty"` SearchByAny bool `json:"searchByAny,omitempty"` SearchWildcardsEnabled bool `json:"searchWildcardsEnabled,omitempty"` Sortorder []string `json:"sortorder,omitempty"` StartSearch bool `json:"startSearch,omitempty"` }
TemplateGetParameters define the properties used to search Template(s) Properties using the 'omitempty' json parameters are optional
type TemplateGetResponse ¶
type TemplateGetResponse struct { Id string `json:"templateid,omitempty"` Host string `json:"host"` Name string `json:"name"` Description string `json:"description"` Proxy_hostid string `json:"proxy_hostid"` Status string `json:"status"` Available string `json:"available"` Disable_until string `json:"disable_until"` Error string `json:"error"` Errors_from string `json:"errors_from"` Lastaccess string `json:"lastaccess"` Flags string `json:"flags"` Snmp_disable_until string `json:"snmp_disable_until"` Snmp_available string `json:"snmp_available"` Snmp_errors_from string `json:"snmp_errors_from"` Snmp_error string `json:"snmp_error"` Ipmi_authtype string `json:"ipmi_authtype"` Ipmi_privilege string `json:"ipmi_privilege"` Ipmi_username string `json:"ipmi_username"` Ipmi_password string `json:"ipmi_password"` Ipmi_available string `json:"ipmi_available"` Ipmi_disable_until string `json:"ipmi_disable_until"` Ipmi_error string `json:"Ipmi_error"` Ipmi_errors_from string `json:"ipmi_errors_from"` Jmx_available string `json:"jmx_available"` Jmx_disable_until string `json:"jmx_disable_until"` Jmx_error string `json:"jmx_error"` Jmx_errors_from string `json:"jmx_errors_from"` Maintenanceid string `json:"maintenanceid"` Maintenance_status string `json:"maintenance_status"` Maintenance_type string `json:"maintenance_type"` Maintenance_from string `json:"maintenance_from"` Tls_connect string `json:"tls_connect"` Tls_accept string `json:"tls_accept"` Tls_issuer string `json:"tls_issuer"` Tls_subject string `json:"tls_subject"` Tls_psk_identity string `json:"tls_psk_identity"` Tls_psk string `json:"tls_psk"` Uuid string `json:"uuid"` }
TemplateGetResponse define the server response format for Get method.
type TemplateId ¶
type TemplateId struct {
Id string `json:"templateid"`
}
TemplateId define a representation for certain methods that only requires the 'templateid' property.
type TemplateMassAddParameters ¶
type TemplateMassAddParameters struct { Templates []*TemplateId `json:"templates"` Groups []*HostGroupId `json:"groups,omitempty"` Macros []*HostMacro `json:"macros,omitempty"` TemplatesLink []*TemplateId `json:"templates_link,omitempty"` }
TemplateMassAddParameters define the properties used for the MassAdd method. Properties using the 'omitempty' json parameters are optional.
type TemplateMassRemoveParameters ¶
type TemplateMassRemoveParameters struct { TemplateIds []string `json:"templateids"` GroupIds []string `json:"groupids,omitempty"` Macros []string `json:"macros,omitempty"` TemplateIdsClear []string `json:"templateids_clear,omitempty"` TemplateIdsUnlink []string `json:"templateids_link,omitempty"` }
TemplateMassRemoveParameters define the properties used for the MassRemove method. Properties using the 'omitempty' json parameters are optional.
type TemplateMassUpdateParameters ¶
type TemplateMassUpdateParameters struct { Templates []*TemplateId `json:"templates"` Groups []*HostGroupId `json:"groups,omitempty"` Macros []*HostMacro `json:"macros,omitempty"` TemplateClear []*TemplateId `json:"templates_clear,omitempty"` TemplateUnlink []*TemplateId `json:"templates_link,omitempty"` }
TemplateMassUpdateParameters define the properties used for the MassUpdate method. Properties using the 'omitempty' json parameters are optional.
type TemplateResponse ¶
type TemplateResponse struct {
Templateids []string `json:"templateids"`
}
TemplateResponse define the server response format for Template methods.
type TemplateService ¶
type TemplateService struct {
Client *ApiClient
}
TemplateService create a new service to access template related methods and functions.
func (*TemplateService) Create ¶
func (t *TemplateService) Create(p *TemplateCreateParameters) (*TemplateResponse, error)
Create is used to create a new Template.
func (*TemplateService) Delete ¶
func (t *TemplateService) Delete(ids []string) (*TemplateResponse, error)
Delete is used to delete one or multiples Templates.
func (*TemplateService) Get ¶
func (t *TemplateService) Get(p *TemplateGetParameters) ([]*TemplateGetResponse, error)
Get is used to retrieve one or multiples Templates matching the given criteria(s).
func (*TemplateService) List ¶
func (t *TemplateService) List() ([]*TemplateGetResponse, error)
List is used to retrieve all Templates.
func (*TemplateService) MassAdd ¶
func (t *TemplateService) MassAdd(p *TemplateMassAddParameters) (*TemplateResponse, error)
MassAdd is used to massively add properties to existing Templates.
func (*TemplateService) MassRemove ¶
func (t *TemplateService) MassRemove(p *TemplateMassRemoveParameters) (*TemplateResponse, error)
MassRemove is used to massively remove properties from existing Templates.
func (*TemplateService) MassUpdate ¶
func (t *TemplateService) MassUpdate(p *TemplateMassUpdateParameters) (*TemplateResponse, error)
MassUpdate is used to massively update or overwrite properties from existing Templates.
func (*TemplateService) Update ¶
func (t *TemplateService) Update(p *TemplateUpdateParameters) (*TemplateResponse, error)
Update is used to update or overwrite properties from an existing Template.
type TemplateTag ¶
TemplateTag define a tag assignable to a Template
type TemplateUpdateParameters ¶
type TemplateUpdateParameters struct { Id string `json:"templateid"` Host string `json:"host,omitempty"` Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Groups []*HostGroupId `json:"groups,omitempty"` Tags []*TemplateTag `json:"tags,omitempty"` Macros []*HostMacro `json:"macros,omitempty"` TemplateLink []*TemplateId `json:"templates,omitempty"` TemplateClear []*TemplateId `json:"templates_clear,omitempty"` }
TemplateUpdateParameters define the properties needed for the Update method. Properties using the 'omitempty' json parameters are optional.
type UserGroup ¶
type UserGroup struct { // ReadOnly Id string `json:"usrgrpid,omitempty"` Name string `json:"name"` Debug_mode UserGroupDebugMode `json:"debug_mode,omitempty"` Gui_access UserGroupGuiAccess `json:"gui_access,omitempty"` Users_status UserGroupStatus `json:"users_status,omitempty"` Userdirectoryid string `json:"userdirectoryid,omitempty"` }
UserGroup properties. Some properties are read-only, which means they are only accessible after creation and should not be passed as arguments in other methods.
type UserGroupCreateParameters ¶ added in v1.0.0
type UserGroupCreateParameters struct { Name string `json:"name"` Debug_mode UserGroupDebugMode `json:"debug_mode,omitempty"` Gui_access UserGroupGuiAccess `json:"gui_access,omitempty"` Users_status UserGroupStatus `json:"users_status,omitempty"` Userdirectoryid string `json:"userdirectoryid,omitempty"` Rights []*UserGroupPermission `json:"rights,omitempty"` Tag_filters []*UserGroupTagPermission `json:"tag_filters,omitempty"` }
type UserGroupDebugMode ¶ added in v1.0.0
type UserGroupDebugMode string
UserGroupDebugMode define whether debug mode should be enabled or not
type UserGroupGetParameters ¶
type UserGroupGetParameters struct { Status int `json:"status,omitempty"` Userids []string `json:"userids,omitempty"` Usrgrpids []string `json:"usrgrpids,omitempty"` SelectTagFilters interface{} `json:"selectTagFilters,omitempty"` SelectUsers interface{} `json:"selectUsers,omitempty"` SelectRights interface{} `json:"selectRights,omitempty"` LimitSelects int `json:"limitSelects,omitempty"` Sortfield []string `json:"sortfield,omitempty"` CountOutput bool `json:"countOutput,omitempty"` Editable bool `json:"editable,omitempty"` ExcludeSearch bool `json:"excludeSearch,omitempty"` Filter interface{} `json:"filter,omitempty"` Limit int `json:"limit,omitempty"` Output interface{} `json:"output,omitempty"` Preservekeys bool `json:"preservekeys,omitempty"` Search interface{} `json:"search,omitempty"` SearchByAny bool `json:"searchByAny,omitempty"` SearchWildcardsEnabled bool `json:"searchWildcardsEnabled,omitempty"` Sortorder []string `json:"sortorder,omitempty"` StartSearch bool `json:"startSearch,omitempty"` }
UserGroupGetParameters define the properties used to search UserGroup(s) Properties using the 'omitempty' json parameters are optional
type UserGroupGuiAccess ¶ added in v1.0.0
type UserGroupGuiAccess string
UserGroupGuiAccess define the type of frontend authentification for users in the group
type UserGroupPermission ¶
type UserGroupPermission struct { Id string `json:"id"` Permission UserGroupPermissionType `json:"permission"` }
UserGroupPermission define a permission assignable to a UserGroup
type UserGroupPermissionType ¶ added in v1.0.0
type UserGroupPermissionType string
UserGroupPermissionType define if the available type of permission level
type UserGroupResponse ¶
type UserGroupResponse struct {
Usrgrpids []string `json:"usrgrpids"`
}
UserGroupResponse define the server response format for UserGroup methods
type UserGroupService ¶
type UserGroupService struct {
Client *ApiClient
}
UserGroupService create a new service to access userGroup related methods and functions.
func (*UserGroupService) Create ¶
func (u *UserGroupService) Create(params *UserGroupCreateParameters) (*UserGroupResponse, error)
Create is used to create a new UserGroup.
func (*UserGroupService) Delete ¶
func (u *UserGroupService) Delete(ids []string) (*UserGroupResponse, error)
Delete is used to delete one or multiples UserGroups.
func (*UserGroupService) Get ¶
func (u *UserGroupService) Get(params *UserGroupGetParameters) ([]*UserGroup, error)
Get is used to retrieve one or multiples UserGroups matching the given criteria(s).
func (*UserGroupService) List ¶
func (u *UserGroupService) List() ([]*UserGroup, error)
List is used to retrieve all UserGroups.
func (*UserGroupService) Update ¶
func (u *UserGroupService) Update(params *UserGroupUpdateParameters) (*UserGroupResponse, error)
Update is used to update or overwrite properties from an existing UserGroup.
type UserGroupStatus ¶ added in v1.0.0
type UserGroupStatus string
UserGroupStatus define if the group should be enabled or not
type UserGroupTagPermission ¶
type UserGroupTagPermission struct { GroupId string `json:"groupid"` Tag string `json:"tag"` Value string `json:"value"` }
UserGroupPermission define a tag assignable to a UserGroup
type UserGroupUpdateParameters ¶ added in v1.0.0
type UserGroupUpdateParameters struct { Id string `json:"usrgrpid"` Name string `json:"name,omitempty"` Debug_mode UserGroupDebugMode `json:"debug_mode,omitempty"` Gui_access UserGroupGuiAccess `json:"gui_access,omitempty"` Users_status UserGroupStatus `json:"users_status,omitempty"` Userdirectoryid string `json:"userdirectoryid,omitempty"` Rights []*UserGroupPermission `json:"rights,omitempty"` Tag_filters []*UserGroupTagPermission `json:"tag_filters,omitempty"` }
type UserMacroGetParameters ¶
type UserMacroGetParameters struct { Globalmacro bool `json:"globalmacro,omitempty"` Globalmacroids []string `json:"globalmacroids,omitempty"` Groupids []string `json:"groupids,omitempty"` Hostids []string `json:"hostids,omitempty"` Hostmacroids []string `json:"hostmacroids,omitempty"` Inherited bool `json:"inherited,omitempty"` SelectHostGroups interface{} `json:"selectHostGroups,omitempty"` SelectHosts interface{} `json:"selectHosts,omitempty"` SelectTemplateGroups interface{} `json:"selectTemplateGroups,omitempty"` SelectTemplates interface{} `json:"selectTemplates,omitempty"` Sortfield []string `json:"sortfield,omitempty"` CountOutput bool `json:"countOutput,omitempty"` Editable bool `json:"editable,omitempty"` ExcludeSearch bool `json:"excludeSearch,omitempty"` Filter interface{} `json:"filter,omitempty"` Limit int `json:"limit,omitempty"` Output interface{} `json:"output,omitempty"` Preservekeys bool `json:"preservekeys,omitempty"` Search interface{} `json:"search,omitempty"` SearchByAny bool `json:"searchByAny,omitempty"` SearchWildcardsEnabled bool `json:"searchWildcardsEnabled,omitempty"` Sortorder []string `json:"sortorder,omitempty"` StartSearch bool `json:"startSearch,omitempty"` }
UserMacroGetParameters define the properties used to search Macro(s) Properties using the 'omitempty' json parameters are optional
type UserMacroService ¶
type UserMacroService struct {
Client *ApiClient
}
UserMacroService create a new service to access macro related methods and functions.
func (*UserMacroService) Create ¶
func (u *UserMacroService) Create(h *HostMacro) (*HostMacroResponse, error)
Create is used to create a new HostMacro.
func (*UserMacroService) CreateGlobal ¶
func (u *UserMacroService) CreateGlobal(g *GlobalMacro) (*GlobalMacroResponse, error)
CreateGlobal is used to create a new GlobalMacro.
func (*UserMacroService) Delete ¶
func (u *UserMacroService) Delete(ids []string) (*HostMacroResponse, error)
Delete is used to delete one or multiples HostMacro.
func (*UserMacroService) DeleteGlobal ¶
func (u *UserMacroService) DeleteGlobal(ids []string) (*GlobalMacroResponse, error)
DeleteGlobal is used to delete one or multiples GlobalMacros.
func (*UserMacroService) Get ¶
func (u *UserMacroService) Get(p *UserMacroGetParameters) ([]*HostMacro, error)
Get is used to retrieve one or multiples HostMacros matching the given criteria(s).
func (*UserMacroService) GetGlobal ¶
func (u *UserMacroService) GetGlobal(p *UserMacroGetParameters) ([]*GlobalMacro, error)
GetGlobal is used to retrieve one or multiples GlobalMacros matching the given criteria(s).
func (*UserMacroService) Update ¶
func (u *UserMacroService) Update(h *HostMacro) (*HostMacroResponse, error)
Update is used to update or overwrite properties from an existing HostMacro.
func (*UserMacroService) UpdateGlobal ¶
func (u *UserMacroService) UpdateGlobal(m *GlobalMacro) (*GlobalMacroResponse, error)
UpdateGlobal is used to update or overwrite properties from an existing GlobalMacro.
type ZabbixService ¶
type ZabbixService struct { Auth *AuthService UserGroup *UserGroupService UserMacro *UserMacroService HostGroup *HostGroupService Template *TemplateService HostInterface *HostInterfaceService Host *HostService }
ZabbixService define the base service to interact with API methods.
func NewZabbixService ¶
func NewZabbixService() *ZabbixService
NewZabbixService create a new ZabbixService. During the creation process, each sub-service http.Client is initialize.
func (*ZabbixService) Authenticate ¶
func (s *ZabbixService) Authenticate() error
Authenticate is a wrapper that while execute the GetCredentials method and update the Token property for the current ZabbixService. When updating the Token, all subservices while see their Token property updated as well.
func (ZabbixService) SetToken ¶
func (s ZabbixService) SetToken(token string)
SetToken is used to set the Token property of each sub-service for the current ZabbiService with the given token.
func (ZabbixService) SetUrl ¶
func (s ZabbixService) SetUrl(url string)
SetUrl is used to set the Url property of each sub-service for the current ZabbiService with the given url.
func (ZabbixService) SetUser ¶
func (s ZabbixService) SetUser(user *ApiUser)
SetUser is used to set the User property of the AuthService for the current ZabbixService.
func (ZabbixService) TestConnectivity ¶ added in v0.0.2
func (s ZabbixService) TestConnectivity()