handlers

package
v5.0.11 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2023 License: MIT Imports: 46 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteAction

func DeleteAction(w http.ResponseWriter, r *http.Request)

DeleteAction godoc @Summary Delete a action definition @Description Delete a action definition @Tags Actions @Produce json @Param id path string true "Action ID" @Security Bearer @Success 200 "Status OK" @Failure 400 "Status Bad Request" @Router /engine/actions/{id} [delete]

func DeleteCalendar

func DeleteCalendar(w http.ResponseWriter, r *http.Request)

DeleteCalendar godoc @Summary Delete calendar @Description Delete calendar @Tags Calendars @Produce json @Param id path string true "Calendar ID" @Security Bearer @Success 200 "Status OK" @Failure 400 "Status Bad Request" @Failure 500 "Status Internal Server Error" @Router /engine/calendars/{id} [delete]

func DeleteConnectorConfig added in v5.0.9

func DeleteConnectorConfig(w http.ResponseWriter, r *http.Request)

DeleteConnectorConfig godoc @Summary Delete an connectorConfig definition @Description Delete an connectorConfig definition @Tags ConnectorConfigs @Produce json @Param name path string true "ConnectorConfig ID" @Security Bearer @Success 200 "Status OK" @Failure 400 "Status Bad Request" @Router /engine/connectorconfigs/{name} [delete]

func DeleteExternalConfig

func DeleteExternalConfig(w http.ResponseWriter, r *http.Request)

DeleteExternalConfig godoc @Summary Delete an externalConfig definition @Description Delete an externalConfig definition @Tags ExternalConfigs @Produce json @Param name path string true "ExternalConfig ID" @Security Bearer @Success 200 "Status OK" @Failure 400 "Status Bad Request" @Router /engine/externalconfigs/{name} [delete]

func DeleteFact

func DeleteFact(w http.ResponseWriter, r *http.Request)

DeleteFact godoc @Summary Delete a fact definition @Description Delete a fact definition @Tags Facts @Produce json @Param id path string true "Fact ID" @Security Bearer @Success 200 "Status OK" @Failure 400 "Status Bad Request" @Router /engine/facts/{id} [delete]

func DeleteJobSchedule

func DeleteJobSchedule(w http.ResponseWriter, r *http.Request)

DeleteJobSchedule godoc @Summary delete JobSchedule @Description delete JobSchedule @Tags Scheduler @Produce json @Param id path string true "JobSchedule ID" @Security Bearer @Success 200 "Status OK" @Failure 400 "Status Bad Request" @Failure 500 "Status Internal Server Error" @Router /engine/scheduler/jobs/{id} [delete]

func DeleteModel

func DeleteModel(w http.ResponseWriter, r *http.Request)

DeleteModel godoc @Summary Delete a model definition @Description Delete a model definition @Tags Models @Produce json @Param id path string true "Model ID" @Security Bearer @Success 200 "Status OK" @Failure 400 "Status Bad Request" @Router /engine/models/{id} [delete]

func DeletePermission

func DeletePermission(w http.ResponseWriter, r *http.Request)

DeletePermission godoc @Summary Delete permission @Description Deletes an user permission @Tags Permissions @Produce json @Param id path string true "permission ID" @Security Bearer @Success 200 {string} string "status OK" @Failure 400 {string} string "Bad Request" @Failure 500 {string} string "Internal Server Error" @Router /admin/security/permissions/{id} [delete]

func DeleteRole

func DeleteRole(w http.ResponseWriter, r *http.Request)

DeleteRole godoc @Summary Delete role @Description Deletes an user role @Tags Roles @Produce json @Param id path string true "role ID" @Security Bearer @Success 200 {string} string "status OK" @Failure 400 {string} string "Bad Request" @Failure 500 {string} string "Internal Server Error" @Router /admin/security/roles/{id} [delete]

func DeleteRootCause

func DeleteRootCause(w http.ResponseWriter, r *http.Request)

DeleteRootCause godoc @Summary Delete a rootcause definition @Description Delete a rootcause definition @Tags RootCauses @Produce json @Param id path string true "RootCause ID" @Security Bearer @Success 200 "Status OK" @Failure 400 "Status Bad Request" @Router /engine/rootcauses/{id} [delete]

func DeleteRule

func DeleteRule(w http.ResponseWriter, r *http.Request)

DeleteRule godoc @Summary delete rule @Description delete rule @Tags Rules @Produce json @Param id path string true "Rule ID" @Security Bearer @Success 200 "Status OK" @Failure 400 "Status Bad Request" @Failure 500 "Status Internal Server Error" @Router /engine/rules/{id} [delete]

func DeleteSituation

func DeleteSituation(w http.ResponseWriter, r *http.Request)

DeleteSituation godoc @Summary Delete a situation definition @Description Delete a situation definition @Tags Situations @Param id path string true "Situation ID" @Security Bearer @Success 200 "Status OK" @Failure 400 "Status Bad Request" @Router /engine/situations/{id} [delete]

func DeleteSituationTemplateInstance

func DeleteSituationTemplateInstance(w http.ResponseWriter, r *http.Request)

DeleteSituationTemplateInstance godoc @Summary Delete a situation template instance @Description Delete a situation template instance @Tags Situations @Param id path string true "Situation ID" @Param instanceid path string true "Situation Template Instance ID" @Security Bearer @Success 200 "Status OK" @Failure 400 "Status Bad Request" @Router /engine/situations/{id}/instances/{instanceid} [delete]

func DeleteUser

func DeleteUser(w http.ResponseWriter, r *http.Request)

DeleteUser godoc @Summary Delete user @Description Deletes an user user @Tags Users @Produce json @Param id path string true "user ID" @Security Bearer @Success 200 {string} string "status OK" @Failure 400 {string} string "Bad Request" @Failure 500 {string} string "Internal Server Error" @Router /admin/security/users/{id} [delete]

func ExecuteFact

func ExecuteFact(w http.ResponseWriter, r *http.Request)

ExecuteFact godoc @Summary Execute a fact with a given timestamp @Description Execute a fact with a given timestamp @Tags Facts @Produce json @Param id path string true "Fact ID" @Param byName query string false "Find fact by it's name" @Param time query string true "Timestamp used for the fact execution" @Param cache query string false "Cache maximum age in minutes(go duration: 10m, 1h, ...). If unset, use cache with no limit of age. If set to 0, disable cache" @Param nhit query int false "Hit per page" @Param offset query int false "Offset number" @Param placeholders query string false "Placeholders (format: key1:value1,key2:value2)" @Param debug query string false "Debug true/false" @Security Bearer @Success 200 "Status OK" @Failure 400 "Status Bad Request" @Router /engine/facts/{id}/execute [get]

func ExecuteFactFromSource

func ExecuteFactFromSource(w http.ResponseWriter, r *http.Request)

ExecuteFactFromSource godoc @Summary Execute a fact with a given timestamp @Description Execute a fact with a given timestamp @Tags Facts @Consumme json @Produce json @Param fact body interface{} true "Fact definition (json)" @Param time query string true "Timestamp used for the fact execution" @Param nhit query int false "Hit per page" @Param offset query int false "Offset number" @Param placeholders query string false "Placeholders (format key1:value1,key2:value2)" @Param debug query string false "Debug true/false" @Security Bearer @Success 200 "Status OK" @Failure 400 "Status Bad Request" @Router /engine/facts/execute [post]

func FactToESQuery

func FactToESQuery(w http.ResponseWriter, r *http.Request)

FactToESQuery godoc @Summary Execute a fact with a given timestamp @Description Execute a fact with a given timestamp @Tags Facts @Produce json @Param id path string true "Fact ID" @Param byName query string false "Find fact by it's name" @Param situationid query string false "Optional SituationID" @Param instanceid query string false "Optional InstanceID" @Param time query string true "Timestamp used for the fact execution" @Param cache query string false "Cache maximum age in minutes(go duration: 10m, 1h, ...). If unset, use cache with no limit of age. If set to 0, disable cache" @Param nhit query int false "Hit per page" @Param offset query int false "Offset number" @Param placeholders query string false "Placeholders (format: key1:value1,key2:value2)" @Param debug query string false "Debug true/false" @Security Bearer @Success 200 "Status OK" @Failure 400 "Status Bad Request" @Router /engine/facts/{id}/es [get]

func FuncGetLogLevel

func FuncGetLogLevel()

FuncGetLogLevel godoc (only for swagger doc) @Summary Get Log Level @Description Get current logging level @Tags Logs @Produce json @Security Bearer @Success 200 "Status OK" @Failure 400 "Status Bad Request" @Router /log_level [get]

func FuncLogin

func FuncLogin()

FuncLogin godoc (only for swagger doc) @Summary Login @Description Authenticate using basic auth @Description Example : @Description <pre>{"login":"myuser","password":"mypassword"}</pre> @Tags Security @Produce json @Param job body interface{} true "Credentials (json)" @Success 200 "Status OK" @Failure 400 "Status Bad Request" @Router /login [post]

func FuncSetLogLevel

func FuncSetLogLevel()

FuncSetLogLevel godoc (only for swagger doc) @Summary Set Log Level @Description Set logging level @Description Example : @Description <pre>{"level":"info"}</pre> @Tags Logs @Consumme json @Produce json @Param level body interface{} true "Level (json)" @Security Bearer @Success 200 "Status OK" @Failure 400 "Status Bad Request" @Router /log_level [put]

func GetAction

func GetAction(w http.ResponseWriter, r *http.Request)

GetAction godoc @Summary Get a action definition @Description Get a action definition @Tags Actions @Produce json @Param id path string true "Action ID" @Security Bearer @Success 200 {object} models.Action "action" @Failure 400 "Status Bad Request" @Router /engine/actions/{id} [get]

func GetActions

func GetActions(w http.ResponseWriter, r *http.Request)

GetActions godoc @Summary Get all action definitions @Description Get all action definitions @Tags Actions @Produce json @Security Bearer @Success 200 {array} models.Action "list of all actions" @Failure 500 "internal server error" @Router /engine/actions [get]

func GetAlias

func GetAlias(w http.ResponseWriter, r *http.Request)

GetAlias godoc @Title GetAlias @Description returns an alias based on an instance, a document type and a depth @tags Alias @Resource /coordinator @Router /coordinator/alias [post] @Accept json @Success 200 "OK" @Failure 400 "Bad Request" @Failure 500 "Internal Server Error"

func GetAllCron

func GetAllCron(w http.ResponseWriter, r *http.Request)

GetAllCron godoc @Title GetAllCron @Description returns an overview of every defined crons @tags Cron @Resource /coordinator @Router /coordinator/crons [get] @Accept json @Success 200 "OK" @Failure 400 "Bad Request" @Failure 500 "Internal Server Error"

func GetCalendar

func GetCalendar(w http.ResponseWriter, r *http.Request)

GetCalendar godoc @Summary Get a Calendar @Description Get an calendar @Tags Calendars @Produce json @Param id path string true "Calendar ID" @Security Bearer @Success 200 {object} calendar.Calendar "calendar" @Failure 400 "Status Bad Request" @Router /engine/calendars/{id} [get]

func GetCalendars

func GetCalendars(w http.ResponseWriter, r *http.Request)

GetCalendars godoc @Summary Get all calendars @Description Get all calendars @Tags Calendars @Produce json @Security Bearer @Success 200 {array} calendar.Calendar "list of calendars" @Failure 500 "internal server error" @Router /engine/calendars [get]

func GetConnectorConfig added in v5.0.9

func GetConnectorConfig(w http.ResponseWriter, r *http.Request)

GetConnectorConfig godoc @Summary Get an connectorConfig definition @Description Get an connectorConfig definition @Tags ConnectorConfigs @Produce json @Param id path string true "ConnectorConfig ID" @Security Bearer @Success 200 {object} models.ConnectorConfig "connectorConfig" @Failure 400 "Status Bad Request" @Router /engine/connectorconfigs/{id} [get]

func GetConnectorConfigs added in v5.0.9

func GetConnectorConfigs(w http.ResponseWriter, r *http.Request)

GetConnectorConfigs godoc @Summary Get all connectorConfig definitions @Description Get all connectorConfig definitions @Tags ConnectorConfigs @Produce json @Security Bearer @Success 200 {array} models.ConnectorConfig "list of all connectorConfigs" @Failure 500 "internal server error" @Router /engine/connectorconfigs [get]

func GetCron

func GetCron(w http.ResponseWriter, r *http.Request)

GetCron godoc @Title GetCron @Description returns an overview of a single cron @tags Cron @Resource /coordinator @Router /coordinator/cron [get] @Accept json @Success 200 "OK" @Failure 400 "Bad Request" @Failure 500 "Internal Server Error" TODO: ADD URL PARAMS SWAGGER ANNOTATION

func GetExternalConfig

func GetExternalConfig(w http.ResponseWriter, r *http.Request)

GetExternalConfig godoc @Summary Get an externalConfig definition @Description Get an externalConfig definition @Tags ExternalConfigs @Produce json @Param id path string true "ExternalConfig ID" @Security Bearer @Success 200 {object} models.ExternalConfig "externalConfig" @Failure 400 "Status Bad Request" @Router /engine/externalconfigs/{id} [get]

func GetExternalConfigByName added in v5.0.9

func GetExternalConfigByName(w http.ResponseWriter, r *http.Request)

GetExternalConfigByName godoc @Summary Get an externalConfig definition @Description Get an externalConfig definition @Tags ExternalConfigs @Produce json @Param name path string true "ExternalConfig Name" @Security Bearer @Success 200 {object} models.ExternalConfig "externalConfig" @Failure 400 "Status Bad Request" @Router /engine/externalconfigs/name/{name} [get]

func GetExternalConfigs

func GetExternalConfigs(w http.ResponseWriter, r *http.Request)

GetExternalConfigs godoc @Summary Get all externalConfig definitions @Description Get all externalConfig definitions @Tags ExternalConfigs @Produce json @Security Bearer @Success 200 {array} models.ExternalConfig "list of all externalConfigs" @Failure 500 "internal server error" @Router /engine/externalconfigs [get]

func GetFact

func GetFact(w http.ResponseWriter, r *http.Request)

GetFact godoc @Summary Get a fact definition @Description Get a fact definition @Tags Facts @Produce json @Param id path string true "Fact ID" @Security Bearer @Success 200 "Status OK" @Failure 400 "Status Bad Request" @Router /engine/facts/{id} [get]

func GetFactHits

func GetFactHits(w http.ResponseWriter, r *http.Request)

GetFactHits godoc @Summary Execute a fact and restitue the hits @Description Execute a fact and restitue the hits @Tags Facts @Produce json @Param id path string true "Fact ID" @Param time query string true "Timestamp used for the fact execution" @Param nhit query int false "Hit per page" @Param offset query int false "Offset number" @Param situationId query string false "Situation Id, necessary if the fact is template" @Param situationInstanceId query string false "Situation instance Id if applicable" @Param debug query string false "Debug true/false" @Security Bearer @Success 200 "Status OK" @Failure 400 "Status Bad Request" @Router /engine/facts/{id}/hits [get]

func GetFacts

func GetFacts(w http.ResponseWriter, r *http.Request)

GetFacts godoc @Summary Get all fact definitions @Description Get all fact definitions @Tags Facts @Produce json @Security Bearer @Success 200 "Status OK" @Failure 500 "internal server error" @Router /engine/facts [get]

func GetIssue

func GetIssue(w http.ResponseWriter, r *http.Request)

GetIssue godoc @Summary Get an issue @Description Get an issue @Tags Issues @Produce json @Param id path string true "Issue ID" @Security Bearer @Success 200 "Status OK" @Failure 400 "Status Bad Request" @Router /engine/issues/{id} [get]

func GetIssueFactsHistory

func GetIssueFactsHistory(w http.ResponseWriter, r *http.Request)

GetIssueFactsHistory godoc @Summary Get the facts history for an issue @Description Get the facts history for an issue @Tags Issues @Produce json @Param id path string true "Issue ID" @Security Bearer @Success 200 "Status OK" @Failure 500 "Status Internal Server Error" @Failure 404 "Status Not Found" @Router /engine/issues/{id}/facts_history [get]

func GetIssueFeedbackTree

func GetIssueFeedbackTree(w http.ResponseWriter, r *http.Request)

GetIssueFeedbackTree godoc @Summary Generate the rootcauses/actions recommendation tree @Description Generate the rootcauses/actions recommendation tree for an issue @Tags Issues @Accept json @Produce json @Param id path string true "Issue ID" @Security Bearer @Success 200 {object} models.FrontRecommendation "recommendation" @Failure 400 "Status Bad Request" @Failure 500 "Status" internal server error" @Router /engine/issues/{id}/recommendation [get]

func GetIssueHistory

func GetIssueHistory(w http.ResponseWriter, r *http.Request)

GetIssueHistory godoc @Summary Get an issue history @Description Get an issue history @Tags Issues @Produce json @Param id path string true "Issue ID" @Security Bearer @Success 200 "Status OK" @Failure 400 "Status Bad Request" @Router /engine/issues/{id}/history [get]

func GetIssues

func GetIssues(w http.ResponseWriter, r *http.Request)

GetIssues godoc @Summary Get all issues @Description Get all issues @Tags Issues @Produce json @Security Bearer @Success 200 "Status OK" @Failure 500 "internal server error" @Router /admin/engine/issues_all [get]

func GetIssuesByStatesByPage

func GetIssuesByStatesByPage(w http.ResponseWriter, r *http.Request)

GetIssuesByStatesByPage godoc @Summary Get issues by issues states (paginated) @Description Get issues by issues states (paginated) @Tags Issues @Produce json @Param states query string true "Issue states (comma separated) (Available: open, draft, closedfeedback, closednofeedback, closedtimeout)" @Param limit query string false "Result limit (default: 50)" @Param offset query string false "Result offset (default: 0)" @Param sort_by query string false "Result offset (example: 'sort_by=desc(last_modified),asc(id)')" @Security Bearer @Success 200 "Status OK" @Failure 500 "internal server error" @Router /engine/issues [get]

func GetJobSchedule

func GetJobSchedule(w http.ResponseWriter, r *http.Request)

GetJobSchedule godoc @Summary Get a JobSchedule @Description Get a specific JobSchedule by it's ID @Tags Scheduler @Produce json @Param id path string true "job ID" @Security Bearer @Success 200 {object} scheduler.InternalSchedule "schedule" @Failure 500 "internal server error" @Router /engine/scheduler/jobs/{id} [get]

func GetJobSchedules

func GetJobSchedules(w http.ResponseWriter, r *http.Request)

GetJobSchedules godoc @Summary Get all JobSchedules @Description Get all JobSchedules from scheduler repository @Tags Scheduler @Produce json @Security Bearer @Success 200 {array} scheduler.InternalSchedule "list of schedules" @Failure 500 "internal server error" @Router /engine/scheduler/jobs [get]

func GetModel

func GetModel(w http.ResponseWriter, r *http.Request)

GetModel godoc @Summary Get a model definition @Description Get a model definition @Tags Models @Produce json @Param id path string true "Model ID" @Param byName query string false "Find model by it's name" @Security Bearer @Success 200 "Status OK" @Failure 400 "Status Bad Request" @Router /engine/models/{id} [get]

func GetModels

func GetModels(w http.ResponseWriter, r *http.Request)

GetModels godoc @Summary Get all model definitions @Description Get all model definitions @Tags Models @Produce json @Security Bearer @Success 200 "Status OK" @Failure 500 "internal server error" @Router /engine/models [get]

func GetNotifications

func GetNotifications(w http.ResponseWriter, r *http.Request)

GetNotifications godoc @Summary Get all notifications @Description Get all notifications of the authentified user @Tags Notifications @Produce json @Param maxage query string false "Notification maximum age (use duration format, ex: 48h)" @Param nhit query int false "Hit per page" @Param offset query int false "Offset number for pagination" @Security Bearer @Success 200 {array} notification.FrontNotification "list of notifications" @Failure 500 "internal server error" @Router /engine/notifications [get]

func GetPermission

func GetPermission(w http.ResponseWriter, r *http.Request)

GetPermission godoc @Summary Get an user permission @Description Gets an user permission with the specified id @Tags Permissions @Produce json @Param id path string true "permission ID" @Security Bearer @Success 200 {object} permissions.Permission "permission" @Failure 400 {string} string "Bad Request" @Failure 404 {string} string "Not Found" @Failure 500 {string} string "Internal Server Error" @Router /admin/security/permissions/{id} [get]

func GetPermissions

func GetPermissions(w http.ResponseWriter, r *http.Request)

GetPermissions godoc @Summary Get all user permissions @Description Gets a list of all user permissions. @Tags Permissions @Produce json @Security Bearer @Success 200 {array} permissions.Permission "list of permissions" @Failure 500 {string} string "Internal Server Error" @Router /admin/security/permissions [get]

func GetResolvedCalendar

func GetResolvedCalendar(w http.ResponseWriter, r *http.Request)

GetResolvedCalendar godoc @Summary Get a resolved Calendar @Description Get a resolved Calendar @Tags Calendars @Produce json @Param id path string true "Calendar ID" @Security Bearer @Success 200 {object} calendar.Calendar "calendar" @Failure 400 "Status Bad Request" @Router /engine/calendars/resolved/{id} [get]

func GetRole

func GetRole(w http.ResponseWriter, r *http.Request)

GetRole godoc @Summary Get an user role @Description Gets an user role with the specified id @Tags Roles @Produce json @Param id path string true "role ID" @Security Bearer @Success 200 {object} roles.Role "role" @Failure 400 {string} string "Bad Request" @Failure 404 {string} string "Not Found" @Failure 500 {string} string "Internal Server Error" @Router /admin/security/roles/{id} [get]

func GetRolePermissions

func GetRolePermissions(w http.ResponseWriter, r *http.Request)

GetRolePermissions godoc @Summary Get all permissions associated with a role @Description Get all permissions associated with a specified role id @Tags Roles @Produce json @Param id path string true "role ID" @Security Bearer @Success 200 {array} permissions.Permission "permission" @Failure 400 {string} string "Bad Request" @Failure 404 {string} string "Not Found" @Failure 500 {string} string "Internal Server Error" @Router /admin/security/roles/{id}/permissions [get]

func GetRoles

func GetRoles(w http.ResponseWriter, r *http.Request)

GetRoles godoc @Summary Get all user roles @Description Gets a list of all user roles. @Tags Roles @Produce json @Security Bearer @Success 200 {array} roles.Role "list of roles" @Failure 500 {string} string "Internal Server Error" @Router /admin/security/roles [get]

func GetRootCause

func GetRootCause(w http.ResponseWriter, r *http.Request)

GetRootCause godoc @Summary Get a rootcause definition @Description Get a rootcause definition @Tags RootCauses @Produce json @Param id path string true "RootCause ID" @Security Bearer @Success 200 {object} models.RootCause "rootcause" @Failure 400 "Status Bad Request" @Router /engine/rootcauses/{id} [get]

func GetRootCauses

func GetRootCauses(w http.ResponseWriter, r *http.Request)

GetRootCauses godoc @Summary Get all rootcause definitions @Description Get all rootcause definitions @Tags RootCauses @Produce json @Security Bearer @Success 200 {array} models.RootCause "list of rootcauses" @Failure 500 "internal server error" @Router /engine/rootcauses [get]

func GetRule

func GetRule(w http.ResponseWriter, r *http.Request)

GetRule godoc @Summary Get a rule @Description Get a specific rule by it's ID @Tags Rules @Produce json @Param id path string true "Rule ID" @Security Bearer @Success 200 {object} rule.Rule "rule" @Failure 500 "internal server error" @Router /engine/rules/{id} [get]

func GetRuleByVersion

func GetRuleByVersion(w http.ResponseWriter, r *http.Request)

GetRuleByVersion godoc @Summary Get a rule @Description Get a specific rule by it's ID @Tags Rules @Produce json @Param id path string true "Rule ID" @Security Bearer @Success 200 {object} rule.Rule "rule" @Failure 500 "internal server error" @Router /engine/rules/{id}/versions/{versionid} [get]

func GetRuleSituations

func GetRuleSituations(w http.ResponseWriter, r *http.Request)

GetRuleSituations godoc @Summary Get the list of situatons associated to a rule @Description Get the list of situatons associated to a rule @Tags Rules @Produce json @Param id path string true "Rule ID" @Security Bearer @Success 200 {array} situation.Situation "list of situations" @Failure 400 "Status Bad Request" @Failure 401 "Status Unauthorized" @Router /engine/rules/{id}/situations [get]

func GetRules

func GetRules(w http.ResponseWriter, r *http.Request)

GetRules godoc @Summary Get all rules @Description Get all rules from rules repository @Tags Rules @Produce json @Security Bearer @Success 200 {array} rule.Rule "list of rules" @Failure 500 "internal server error" @Router /engine/rules [get]

func GetSituation

func GetSituation(w http.ResponseWriter, r *http.Request)

GetSituation godoc @Summary Get a situation definition @Description Get a situation definition @Tags Situations @Produce json @Param id path string true "Situation ID" @Security Bearer @Success 200 {object} situation.Situation "situation" @Failure 400 "Status Bad Request" @Router /engine/situations/{id} [get]

func GetSituationEvaluation

func GetSituationEvaluation(w http.ResponseWriter, r *http.Request)

GetSituationEvaluation godoc @Summary Get the last evaluation of a situation @Description Get the last evaluation of a situation @Tags Situations @Produce json @Param id path string true "Situation ID" @Param instanceid path string true "Situation Template Instance ID" @Security Bearer @Success 200 "Status OK" @Failure 400 "Status Bad Request" @Router /engine/situations/{id}/evaluation/{instanceid} [get]

func GetSituationFacts

func GetSituationFacts(w http.ResponseWriter, r *http.Request)

GetSituationFacts godoc @Summary Get the list of facts for the evaluation of a situation @Description Get the list of facts for the evaluation of a situation @Tags Situations @Produce json @Param id path string true "Situation ID" @Security Bearer @Success 200 "Status OK" @Failure 400 "Status Bad Request" @Failure 401 "Status Unauthorized" @Router /engine/situations/{id}/facts [get]

func GetSituationRules

func GetSituationRules(w http.ResponseWriter, r *http.Request)

GetSituationRules godoc @Summary Get the list of rules for the evaluation of a situation @Description Get the list of rules for the evaluation of a situation @Tags Situations @Produce json @Param id path string true "Situation ID" @Security Bearer @Success 200 {array} rule.Rule @Failure 400 "Status Bad Request" @Failure 401 "Status Unauthorized" @Router /engine/situations/{id}/rules [get]

func GetSituationTemplateInstances

func GetSituationTemplateInstances(w http.ResponseWriter, r *http.Request)

GetSituationTemplateInstances godoc @Summary Get the list of situation template instances @Description Get the list of situation template instances @Tags Situations @Produce json @Param id path string true "Situation ID" @Security Bearer @Success 200 {array} situation.TemplateInstance @Failure 400 "Status Bad Request" @Failure 401 "Status Unauthorized" @Router /engine/situations/{id}/instances [get]

func GetSituations

func GetSituations(w http.ResponseWriter, r *http.Request)

GetSituations godoc @Summary Get all situation definitions @Description Get all situation definitions @Tags Situations @Produce json @Security Bearer @Success 200 {array} situation.Situation "list of situations" @Failure 500 "internal server error" @Router /engine/situations [get]

func GetUser

func GetUser(w http.ResponseWriter, r *http.Request)

GetUser godoc @Summary Get an user user @Description Gets an user user with the specified id @Tags Users @Produce json @Param id path string true "user ID" @Security Bearer @Success 200 {object} users.User "user" @Failure 400 {string} string "Bad Request" @Failure 404 {string} string "Not Found" @Failure 500 {string} string "Internal Server Error" @Router /admin/security/users/{id} [get]

func GetUserFromContext

func GetUserFromContext(r *http.Request) (users.UserWithPermissions, bool)

GetUserFromContext extract the logged user from the request context

func GetUserSelf

func GetUserSelf(w http.ResponseWriter, r *http.Request)

GetUserSelf godoc @Summary Get an user @Description Gets un user with the specified id. @Tags Users @Produce json @Security Bearer @Success 200 {string} string "status OK" @Failure 400 {string} string "Bad Request" @Failure 500 {string} string "Internal Server Error" @Router /engine/security/myself [get]

func GetUsers

func GetUsers(w http.ResponseWriter, r *http.Request)

GetUsers godoc @Summary Get all user users @Description Gets a list of all user users. @Tags Users @Produce json @Security Bearer @Success 200 {array} users.User "list of users" @Failure 500 {string} string "Internal Server Error" @Router /admin/security/users [get]

func GetlastConnectorExecutionDateTime

func GetlastConnectorExecutionDateTime(w http.ResponseWriter, r *http.Request)

GetlastConnectorExecutionDateTime godoc @Summary Get the DateTime of the last connections readings @Description Gets the DateTime of the last connections readings. @Tags Admin @Produce json @Param id path string true "Connector ID" @Param successOnly query string false "true to ignore failed connector executions" @Param maxage query string false "maximum age of data (duration)" @Security Bearer @Success 200 {string} string "Status OK" @Failure 400 {string} string "Bad Request" @Failure 500 {string} string "Internal Server Error" @Router /engine/connector/{id}/executions/last [get]

func IsAlive

func IsAlive(w http.ResponseWriter, r *http.Request)

IsAlive godoc @Summary Check if alive @Description allows to check if the API is alive @Tags System @Success 200 "Status OK" @Router /isalive [get]

func IsInCalendarPeriod

func IsInCalendarPeriod(w http.ResponseWriter, r *http.Request)

IsInCalendarPeriod godoc @Summary Determines wether a timestamp is within a valid calendar period @Description Determines wether a timestamp is within a valid calendar period @Tags Calendars @Produce json @Param id path string true "Calendar ID" @Param time query string true "Timestamp to be found within a calendar period" @Security Bearer @Success 200 {object} calendar.InPeriodContains "InPeriodContains" @Failure 400 "Status Bad Request" @Router /engine/calendars/{id}/contains [get]

func NotImplemented

func NotImplemented(w http.ResponseWriter, r *http.Request)

NotImplemented returns a basic message "Not Implemented" when called, and should be use a filler for future handler

func NotificationsSSERegister

func NotificationsSSERegister(w http.ResponseWriter, r *http.Request)

NotificationsSSERegister godoc @Summary Register a new client to the notifications system using SSE @Description Register a new client to the notifications system using SSE @Tags Notifications @Produce json @Param jwt query string false "Json Web Token" @Security Bearer @Success 200 "Status OK" @Failure 400 "Status Bad Request" @Router /engine/notifications/sse [get]

func NotificationsWSRegister

func NotificationsWSRegister(w http.ResponseWriter, r *http.Request)

NotificationsWSRegister godoc @Summary Register a new client to the notifications system using WS @Description Register a new client to the notifications system using WS @Tags Notifications @Produce json @Param jwt query string false "Json Web Token" @Security Bearer @Success 200 "Status OK" @Failure 400 "Status Bad Request" @Router /engine/notifications/ws [get]

func ParseDuration

func ParseDuration(dStr string) (time.Duration, error)

ParseDuration try to parse a string as an int or returns 0

func ParseInt

func ParseInt(tStr string) (int, error)

ParseInt try to parse a string as an int or returns 0

func ParseSortBy

func ParseSortBy(rawSortByStr string, allowedFields []string) ([]models.SortOption, error)

ParseSortBy parse multiple <order>(<field>) entries separated by commas from a string

func ParseTime

func ParseTime(tStr string) (time.Time, error)

ParseTime try to parse a supposed time string as a time.Time or returns time.Now()

func PostAction

func PostAction(w http.ResponseWriter, r *http.Request)

PostAction godoc @Summary Create a new action definition @Description Create a new action definition @Tags Actions @Accept json @Produce json @Param action body models.Action true "Action definition (json)" @Security Bearer @Success 200 {object} models.Action "action" @Failure 400 "Status Bad Request" @Failure 500 "Status" internal server error" @Router /engine/actions [post]

func PostAggregates

func PostAggregates(w http.ResponseWriter, r *http.Request)

PostAggregates godoc @Summary Receive aggregates to be evaluated @Description Receive aggregates to be evaluated @Tags Service @Consume json @Produce json @Param query body []ExternalAggregate true "query (json)" @Security Bearer @Success 200 "Status OK" @Failure 500 "internal server error" @Router /service/aggregates [post]

func PostCalendar

func PostCalendar(w http.ResponseWriter, r *http.Request)

PostCalendar godoc @Summary Creates a Calendar @Description Creates a Calendar @Tags Calendars @Accept json @Produce json @Param calendar body interface{} true "Calendar (json)" @Security Bearer @Success 200 {object} calendar.Calendar "calendar" @Failure 400 "Status Bad Request" @Failure 500 "Status" internal server error" @Router /engine/calendars [post]

func PostConnectorConfig added in v5.0.9

func PostConnectorConfig(w http.ResponseWriter, r *http.Request)

PostConnectorConfig godoc @Summary Create a new connectorConfig definition @Description Create a new connectorConfig definition @Tags ConnectorConfigs @Accept json @Produce json @Param connectorConfig body models.ConnectorConfig true "ConnectorConfig definition (json)" @Security Bearer @Success 200 {object} models.ConnectorConfig "connectorConfig" @Failure 400 "Status Bad Request" @Failure 500 "Status" internal server error" @Router /engine/connectorconfigs [post]

func PostExternalConfig

func PostExternalConfig(w http.ResponseWriter, r *http.Request)

PostExternalConfig godoc @Summary Create a new externalConfig definition @Description Create a new externalConfig definition @Tags ExternalConfigs @Accept json @Produce json @Param externalConfig body models.ExternalConfig true "ExternalConfig definition (json)" @Security Bearer @Success 200 {object} models.ExternalConfig "externalConfig" @Failure 400 "Status Bad Request" @Failure 500 "Status" internal server error" @Router /engine/externalconfigs [post]

func PostFact

func PostFact(w http.ResponseWriter, r *http.Request)

PostFact godoc @Summary Create a new fact definition @Description Create a new fact definition @Tags Facts @Accept json @Produce json @Param fact body interface{} true "Fact definition (json)" @Security Bearer @Success 200 "Status OK" @Failure 400 "Status Bad Request" @Failure 500 "Status" internal server error" @Router /engine/facts [post]

func PostIssue

func PostIssue(w http.ResponseWriter, r *http.Request)

PostIssue godoc @Summary Creates an issue @Description Creates an issue @Tags Issues @Accept json @Produce json @Param issue body interface{} true "Issue (json)" @Security Bearer @Success 200 "Status OK" @Failure 400 "Status Bad Request" @Failure 500 "Status" internal server error" @Router /engine/issues [post]

func PostIssueCloseWithFeedback

func PostIssueCloseWithFeedback(w http.ResponseWriter, r *http.Request)

PostIssueCloseWithFeedback godoc @Summary Send a rootcauses/actions feedback on an issue @Description Post a rootcauses/actions recommendation tree as a feedback on an issue @Tags Issues @Accept json @Produce json @Param id path string true "Issue ID" @Param issue body interface{} true "Recommendation tree (json)" @Security Bearer @Success 200 "Status OK" @Failure 400 "Status Bad Request" @Failure 500 "Status" internal server error" @Router /engine/issues/{id}/feedback [post]

func PostIssueCloseWithoutFeedback

func PostIssueCloseWithoutFeedback(w http.ResponseWriter, r *http.Request)

PostIssueCloseWithoutFeedback godoc @Summary Close an issue without feedback @Description Close an issue without feedback @Tags Issues @Accept json @Produce json @Param id path string true "Issue ID" @Param reason body interface{} false "Close reason (json)" @Security Bearer @Success 200 "Status OK" @Failure 400 "Status Bad Request" @Failure 500 "Status" internal server error" @Router /engine/issues/{id}/close [post]

func PostIssueDetectionFeedback

func PostIssueDetectionFeedback(w http.ResponseWriter, r *http.Request)

PostIssueDetectionFeedback godoc @Summary Add a new detection feedback @Description Add a new detection feedback on an issue (or replace an existing one if the user already made a feedback) @Tags Issues @Accept json @Produce json @Param id path string true "Issue ID" @Param reason body interface{} false "Rating" @Security Bearer @Success 200 "Status OK" @Failure 400 "Status Bad Request" @Failure 500 "Status" internal server error" @Router /engine/issues/{id}/detection/feedback [post]

func PostIssueDraft

func PostIssueDraft(w http.ResponseWriter, r *http.Request)

PostIssueDraft godoc @Summary Send a rootcauses/actions feedback draft on an issue @Description Post a rootcauses/actions recommendation tree as a feedback draft on an issue @Tags Issues @Accept json @Produce json @Param id path string true "Issue ID" @Param issue body models.FrontRecommendation true "Draft Recommendation tree (json)" @Security Bearer @Success 200 "Status OK" @Failure 400 "Status Bad Request" @Failure 500 "Status" internal server error" @Router /engine/issues/{id}/draft [post]

func PostJobSchedule

func PostJobSchedule(w http.ResponseWriter, r *http.Request)

PostJobSchedule godoc @Summary create JobSchedule @Description creates new JobSchedule @Tags Scheduler @Accept json @Produce json @Param job body scheduler.InternalSchedule true "JobSchedule definition (json)" @Security Bearer @Success 200 {object} scheduler.InternalSchedule "schedule" @Failure 400 "Status Bad Request" @Failure 500 "Status Internal Server Error" @Router /engine/scheduler/jobs [post]

func PostModel

func PostModel(w http.ResponseWriter, r *http.Request)

PostModel godoc @Summary Create a new model definition @Description Create a new model definition @Tags Models @Accept json @Produce json @Param model body interface{} true "Model definition (json)" @Security Bearer @Success 200 "Status OK" @Failure 400 "Status Bad Request" @Failure 500 "Status" internal server error" @Router /engine/models [post]

func PostObjects

func PostObjects(w http.ResponseWriter, r *http.Request)

PostObjects godoc @Summary Receive objects to be evaluated @Description Receive objects to be evaluated @Tags Service @Produce json @Param fact query string true "Fact object name" @Security Bearer @Success 200 "Status OK" @Failure 500 "internal server error" @Router /service/objects [post]

func PostPermission

func PostPermission(w http.ResponseWriter, r *http.Request)

PostPermission godoc @Summary Create a new permission @Description Add an user permission to the user permissions @Tags Permissions @Accept json @Produce json @Param permission body permissions.Permission true "permission (json)" @Security Bearer @Success 200 {object} permissions.Permission "permission" @Failure 400 {string} string "Bad Request" @Failure 500 {string} string "Internal Server Error" @Router /admin/security/permissions [post]

func PostRole

func PostRole(w http.ResponseWriter, r *http.Request)

PostRole godoc @Summary Create a new role @Description Add an user role to the user roles @Tags Roles @Accept json @Produce json @Param role body roles.Role true "role (json)" @Security Bearer @Success 200 {object} roles.Role "role" @Failure 400 {string} string "Bad Request" @Failure 500 {string} string "Internal Server Error" @Router /admin/security/roles [post]

func PostRootCause

func PostRootCause(w http.ResponseWriter, r *http.Request)

PostRootCause godoc @Summary Create a new rootcause definition @Description Create a new rootcause definition @Tags RootCauses @Accept json @Produce json @Param rootcause body models.RootCause true "RootCause definition (json)" @Security Bearer @Success 200 {object} models.RootCause "rootcause" @Failure 400 "Status Bad Request" @Failure 500 "Status" internal server error" @Router /engine/rootcauses [post]

func PostRule

func PostRule(w http.ResponseWriter, r *http.Request)

PostRule godoc @Summary create rule @Description creates new rule @Tags Rules @Accept json @Produce json @Param rule body rule.Rule true "Rule definition (json)" @Security Bearer @Success 200 {object} rule.Rule "rule" @Failure 400 "Status Bad Request" @Failure 500 "Status Internal Server Error" @Router /engine/rules [post]

func PostRuleSituations

func PostRuleSituations(w http.ResponseWriter, r *http.Request)

PostRuleSituations godoc @Summary Add the rule at the end of the rules list of each situation @Description Add the rule at the end of the rules list of each situation @Tags Rules @Produce json @Param id path string true "Rule ID" @Param situationIds body {array} true "Situation association" @Security Bearer @Success 200 "Status OK" @Failure 400 "Status Bad Request" @Failure 401 "Status Unauthorized" @Router /engine/rules/{id}/situations [post]

func PostSituation

func PostSituation(w http.ResponseWriter, r *http.Request)

PostSituation godoc @Summary Creates a situation definition @Description Creates a situation definition @Tags Situations @Accept json @Produce json @Param factsByName query string false "Find fact by it's name" @Param situation body situation.Situation true "Situation definition (json)" @Security Bearer @Success 200 {object} situation.Situation "situation" @Failure 400 "Status Bad Request" @Failure 500 "Status" internal server error" @Router /engine/situations [post]

func PostSituationTemplateInstance

func PostSituationTemplateInstance(w http.ResponseWriter, r *http.Request)

PostSituationTemplateInstance godoc @Summary Creates a situation template instance @Description Creates a situation template instance @Tags Situations @Accept json @Produce json @Param id path string true "Situation ID" @Param templateInstance body situation.TemplateInstance true "Situation template instance (json)" @Security Bearer @Success 200 {object} situation.TemplateInstance "situation template instance" @Failure 400 "Status Bad Request" @Failure 500 "Status" internal server error" @Router /engine/situations/{id}/instances [post]

func PostUser

func PostUser(w http.ResponseWriter, r *http.Request)

PostUser godoc @Summary Create a new user @Description Add an user user to the user users @Tags Users @Accept json @Produce json @Param user body users.User true "user (json)" @Security Bearer @Success 200 {object} users.User "user" @Failure 400 {string} string "Bad Request" @Failure 500 {string} string "Internal Server Error" @Router /admin/security/users [post]

func PutAction

func PutAction(w http.ResponseWriter, r *http.Request)

PutAction godoc @Summary Create or remplace a action definition @Description Create or remplace a action definition @Tags Actions @Accept json @Produce json @Param id path string true "Action ID" @Param action body models.Action true "Action definition (json)" @Security Bearer @Success 200 {object} models.Action "action" @Failure 400 "Status Bad Request" @Failure 500 "Status" internal server error" @Router /engine/actions/{id} [put]

func PutCalendar

func PutCalendar(w http.ResponseWriter, r *http.Request)

PutCalendar godoc @Summary Update a calendar @Description Updates the calendar @Tags Calendars @Accept json @Produce json @Param id path string true "Calendar ID" @Param user body interface{} true "calendar (json)" @Security Bearer @Success 200 {object} calendar.Calendar "calendar" @Failure 400 {string} string "Bad Request" @Failure 500 {string} string "Internal Server Error" @Router /engine/calendars/{id} [put]

func PutConnectorConfig added in v5.0.9

func PutConnectorConfig(w http.ResponseWriter, r *http.Request)

PutConnectorConfig godoc @Summary Create or remplace an connectorConfig definition @Description Create or remplace an connectorConfig definition @Tags ConnectorConfigs @Accept json @Produce json @Param name path string true "ConnectorConfig ID" @Param connectorConfig body models.ConnectorConfig true "ConnectorConfig definition (json)" @Security Bearer @Success 200 {object} models.ConnectorConfig "connectorConfig" @Failure 400 "Status Bad Request" @Failure 500 "Status" internal server error" @Router /engine/connectorconfigs/{name} [put]

func PutExternalConfig

func PutExternalConfig(w http.ResponseWriter, r *http.Request)

PutExternalConfig godoc @Summary Create or remplace an externalConfig definition @Description Create or remplace an externalConfig definition @Tags ExternalConfigs @Accept json @Produce json @Param name path string true "ExternalConfig ID" @Param externalConfig body models.ExternalConfig true "ExternalConfig definition (json)" @Security Bearer @Success 200 {object} models.ExternalConfig "externalConfig" @Failure 400 "Status Bad Request" @Failure 500 "Status" internal server error" @Router /engine/externalconfigs/{name} [put]

func PutFact

func PutFact(w http.ResponseWriter, r *http.Request)

PutFact godoc @Summary Create or remplace a fact definition @Description Create or remplace a fact definition @Tags Facts @Accept json @Produce json @Param id path string true "Fact ID" @Param fact body interface{} true "Fact definition (json)" @Security Bearer @Success 200 "Status OK" @Failure 400 "Status Bad Request" @Failure 500 "Status" internal server error" @Router /engine/facts/{id} [put]

func PutJobSchedule

func PutJobSchedule(w http.ResponseWriter, r *http.Request)

PutJobSchedule godoc @Summary Create or remplace a JobSchedule @Description Create or remplace a JobSchedule @Tags Scheduler @Accept json @Produce json @Param id path string true "JobSchedule ID" @Param rule body interface{} true "JobSchedule (json)" @Security Bearer @Success 200 {object} scheduler.InternalSchedule "schedule" @Failure 400 "Status Bad Request" @Failure 500 "Status" internal server error" @Router /engine/scheduler/jobs/{id} [put]

func PutModel

func PutModel(w http.ResponseWriter, r *http.Request)

PutModel godoc @Summary Create or remplace a model definition @Description Create or remplace a model definition @Tags Models @Accept json @Produce json @Param id path string true "Model ID" @Param model body interface{} true "Model definition (json)" @Security Bearer @Success 200 "Status OK" @Failure 400 "Status Bad Request" @Failure 500 "Status" internal server error" @Router /engine/models/{id} [put]

func PutPermission

func PutPermission(w http.ResponseWriter, r *http.Request)

PutPermission godoc @Summary Update permission @Description Updates the user permission information concerning the user permission with id @Tags Permissions @Accept json @Produce json @Param id path string true "permission ID" @Param permission body permissions.Permission true "permission (json)" @Security Bearer @Success 200 {object} permissions.Permission "permission" @Failure 400 {string} string "Bad Request" @Failure 500 {string} string "Internal Server Error" @Router /admin/security/permissions/{id} [put]

func PutRole

func PutRole(w http.ResponseWriter, r *http.Request)

PutRole godoc @Summary Update role @Description Updates the user role information concerning the user role with id @Tags Roles @Accept json @Produce json @Param id path string true "role ID" @Param role body roles.Role true "role (json)" @Security Bearer @Success 200 {object} roles.Role "role" @Failure 400 {string} string "Bad Request" @Failure 500 {string} string "Internal Server Error" @Router /admin/security/roles/{id} [put]

func PutRootCause

func PutRootCause(w http.ResponseWriter, r *http.Request)

PutRootCause godoc @Summary Create or remplace a rootcause definition @Description Create or remplace a rootcause definition @Tags RootCauses @Accept json @Produce json @Param id path string true "RootCause ID" @Param rootcause body models.RootCause true "RootCause definition (json)" @Security Bearer @Success 200 {object} models.RootCause "rootcause" @Failure 400 "Status Bad Request" @Failure 500 "Status" internal server error" @Router /engine/rootcauses/{id} [put]

func PutRule

func PutRule(w http.ResponseWriter, r *http.Request)

PutRule godoc @Summary Create or remplace a rule definition @Description Create or remplace a rule definition @Tags Rules @Accept json @Produce json @Param id path string true "Rule ID" @Param rule body rule.Rule true "Rule definition (json)" @Security Bearer @Success 200 {object} rule.Rule "rule" @Failure 400 "Status Bad Request" @Failure 500 "Status" internal server error" @Router /engine/rules/{id} [put]

func PutSituation

func PutSituation(w http.ResponseWriter, r *http.Request)

PutSituation godoc @Summary replace a situation definition @Description replace a situation definition @Tags Situations @Accept json @Produce json @Param id path string true "Situation ID" @Param situation body situation.Situation true "Situation definition (json)" @Security Bearer @Success 200 {object} situation.Situation "situation" @Failure 400 "Status Bad Request" @Failure 500 "Status" internal server error" @Router /engine/situations/{id} [put]

func PutSituationTemplateInstance

func PutSituationTemplateInstance(w http.ResponseWriter, r *http.Request)

PutSituationTemplateInstance godoc @Summary replace a situation template instance @Description replace a situation template instance @Tags Situations @Accept json @Produce json @Param id path string true "Situation ID" @Param instanceid path string true "Situation Template Instance ID" @Param templateInstance body situation.TemplateInstance true "Situation template instance (json)" @Security Bearer @Success 200 {object} situation.TemplateInstance "situation template instance" @Failure 400 "Status Bad Request" @Failure 500 "Status" internal server error" @Router /engine/situations/{id}/instances/{instanceid} [put]

func PutSituationTemplateInstances

func PutSituationTemplateInstances(w http.ResponseWriter, r *http.Request)

PutSituationTemplateInstances godoc @Summary set the template instances of the situation @Description set the template instances of the situation @Tags Situations @Accept json @Produce json @Param id path string true "Situation ID" @Param templateInstances body {array} true "Situation template instance list (json array)" @Security Bearer @Success 200 "Status OK" @Failure 400 "Status Bad Request" @Failure 500 "Status" internal server error" @Router /engine/situations/{id}/instances [put]

func PutUser

func PutUser(w http.ResponseWriter, r *http.Request)

PutUser godoc @Summary Update user @Description Updates the user user information concerning the user user with id @Tags Users @Accept json @Produce json @Param id path string true "user ID" @Param user body users.User true "user (json)" @Security Bearer @Success 200 {object} users.User "user" @Failure 400 {string} string "Bad Request" @Failure 500 {string} string "Internal Server Error" @Router /admin/security/users/{id} [put]

func QueryParamToOptionnalBool

func QueryParamToOptionnalBool(r *http.Request, name string, orDefault bool) (bool, error)

func QueryParamToOptionnalDuration

func QueryParamToOptionnalDuration(r *http.Request, name string, orDefault time.Duration) (time.Duration, error)

func QueryParamToOptionnalInt64

func QueryParamToOptionnalInt64(r *http.Request, name string, orDefault int64) (int64, error)

func QueryParamToOptionnalKeyValues added in v5.0.7

func QueryParamToOptionnalKeyValues(r *http.Request, name string, orDefault map[string]string) (map[string]string, error)

QueryParamToOptionnalKeyValues parse multiple key:value entries separated by commas from a string

func QueryParamToOptionnalTime

func QueryParamToOptionnalTime(r *http.Request, name string, orDefault time.Time) (time.Time, error)

func QueryParamToTime

func QueryParamToTime(r *http.Request, name string) (time.Time, error)

func ReceiveAggregates

func ReceiveAggregates(aggregates []scheduler.ExternalAggregate) error

ReceiveAggregates process a slice of ExternalAggregates and trigger all standard fact-situation-rule process

func SearchLast

func SearchLast(w http.ResponseWriter, r *http.Request)

Search godoc @Summary query situation history data @Description query situation history data @Tags Search @Accept json @Produce json @Param situationid query int false "situationid" @Param situationinstanceid query int false "situationinstanceid" @Param maxdate query string false "time.Time" @Param mindate query string false "time.Time" @Security Bearer @Success 200 {array} search.QueryResult "query result" @Failure 500 "internal server error" @Router /engine/search/last [get]

func SearchLastByCustomInterval

func SearchLastByCustomInterval(w http.ResponseWriter, r *http.Request)

Search godoc @Summary query situation history data @Description query situation history data @Tags Search @Accept json @Produce json @Param situationid query int false "situationid" @Param situationinstanceid query int false "situationinstanceid" @Param maxdate query string false "time.Time" @Param mindate query string false "time.Time" @Param referencedate query string true "time.Time" @Param interval query string true "time.Duration" @Security Bearer @Success 200 {array} search.QueryResult "query result" @Failure 500 "internal server error" @Router /engine/search/last/bycustominterval [get]

func SearchLastByInterval

func SearchLastByInterval(w http.ResponseWriter, r *http.Request)

Search godoc @Summary query situation history data @Description query situation history data @Tags Search @Accept json @Produce json @Param situationid query int false "situationid" @Param situationinstanceid query int false "situationinstanceid" @Param maxdate query string false "time.Time" @Param mindate query string false "time.Time" @Param interval query string true "year | quarter | month | week | day | hour | minute" @Security Bearer @Success 200 {array} search.QueryResult "query result" @Failure 500 "internal server error" @Router /engine/search/last/byinterval [get]

func SetRolePermissions

func SetRolePermissions(w http.ResponseWriter, r *http.Request)

SetRolePermissions godoc @Summary Set permissions on a role @Description Set permissions on a role @Tags Roles @Accept json @Produce json @Param id path string true "role ID" @Param role body []string true "List of permissions UUIDs" @Security Bearer @Success 200 {object} roles.Role "role" @Failure 400 {string} string "Bad Request" @Failure 500 {string} string "Internal Server Error" @Router /admin/security/roles/{id}/permissions [put]

func SetSituationRules

func SetSituationRules(w http.ResponseWriter, r *http.Request)

SetSituationRules godoc @Summary Set the list of rules for the evaluation of a situation @Description Set the list of rules for the evaluation of a situation @Tags Situations @Param id path string true "Situation ID" @Param ruleIds body {array} true "Situation Rules" @Security Bearer @Success 200 "Status OK" @Failure 400 "Status Bad Request" @Failure 401 "Status Unauthorized" @Router /engine/situations/{id}/rules [put]

func SetUserRoles

func SetUserRoles(w http.ResponseWriter, r *http.Request)

SetUserRoles godoc @Summary Set roles on a user @Description Set roles on a user @Tags Users @Accept json @Produce json @Param id path string true "user ID" @Param user body []string true "List of roles UUIDs" @Security Bearer @Success 200 {object} users.User "user" @Failure 400 {string} string "Bad Request" @Failure 500 {string} string "Internal Server Error" @Router /admin/security/users/{id}/roles [put]

func StartAllCron

func StartAllCron(w http.ResponseWriter, r *http.Request)

StartAllCron godoc @Title StartAllCron @Description starts every defined crons @tags Cron @Resource /coordinator @Router /coordinator/crons/start [post] @Accept json @Success 200 "OK" @Failure 400 "Bad Request" @Failure 500 "Internal Server Error"

func StartCron

func StartCron(w http.ResponseWriter, r *http.Request)

StartCron godoc @Title StartCron @Description starts a single cron @tags Cron @Resource /coordinator @Router /coordinator/cron/start [post] @Accept json @Success 200 "OK" @Failure 400 "Bad Request" @Failure 500 "Internal Server Error"

func StartScheduler

func StartScheduler(w http.ResponseWriter, r *http.Request)

StartScheduler godoc @Summary Start the scheduler @Description Start the fact scheduler @Tags Scheduler @Success 200 "Status OK" @Security Bearer @Router /engine/scheduler/start [POST]

func StopAllCron

func StopAllCron(w http.ResponseWriter, r *http.Request)

StopAllCron godoc @Title StopAllCron @Description stops every defined crons @tags Cron @Resource /coordinator @Router /coordinator/crons/stop [post] @Accept json @Success 200 "OK" @Failure 400 "Bad Request" @Failure 500 "Internal Server Error" FIXME: Not working

func StopCron

func StopCron(w http.ResponseWriter, r *http.Request)

StopCron godoc @Title StopCron @Description stops a single cron @tags Cron @Resource /coordinator @Router /coordinator/cron/stop [post] @Accept json @Success 200 "OK" @Failure 400 "Bad Request" @Failure 500 "Internal Server Error"

func TestRule

func TestRule(w http.ResponseWriter, r *http.Request)

TODO: Add handler annotation on TestRuleHandler

func TriggerJobSchedule

func TriggerJobSchedule(w http.ResponseWriter, r *http.Request)

TriggerJobSchedule godoc @Summary Force facts calculation pipeline @Description <b>Force facts calculation pipeline</b> @Description Example : @Description <pre>{"jobtype":"fact","job":{"facts_ids":["fact_1","fact_2"]}} @Description {"jobtype":"baseline","job":{"baselines":{"3":["by_day","by_day_week"]}}}</pre> @Tags Scheduler @Produce json @Param job body scheduler.InternalSchedule true "JobSchedule definition (json)" @Security Bearer @Success 200 "Status OK" @Failure 400 "Status Bad Request" @Router /engine/scheduler/trigger [post]

func TriggerNotification

func TriggerNotification(w http.ResponseWriter, r *http.Request)

TriggerNotification godoc @Summary Send a notification @Description Generate a new NotifyTask with a default message for testing @Tags Notifications @Accept json @Param key query string true "Notifier cache key" @Param notification body interface{} true "Notify task definition (json)" @Security Bearer @Success 200 "Status OK" @Failure 400 "Status Bad Request" @Failure 500 "Status" internal server error" @Router /engine/notifications/trigger [post]

func UpdateIssueComment

func UpdateIssueComment(w http.ResponseWriter, r *http.Request)

UpdateIssueComment godoc @Summary Update an issue comment @Description Update an issue comment @Tags Issues @Accept json @Produce json @Param id path string true "Issue ID" @Param reason body interface{} false "Comment to update" @Security Bearer @Success 200 "Status OK" @Failure 400 "Status Bad Request" @Failure 500 "Status" internal server error" @Router /engine/issues/{id}/comment [put]

func UpdateRead

func UpdateRead(w http.ResponseWriter, r *http.Request)

UpdateRead godoc @Summary Update the "read" status of the notification @Description Mark a notification as "read" @Tags Notifications @Produce json @Param id path int false "notification ID" @Param status query boolean false "notification's read property given value" @Security Bearer @Success 200 "Status OK" @Failure 500 "internal server error" @Failure 400 "Status bad request" @Router /engine/notifications/{id}/read [put]

func ValidateAction

func ValidateAction(w http.ResponseWriter, r *http.Request)

ValidateAction godoc @Summary Validate a new action definition @Description Validate a new action definition @Tags Actions @Accept json @Produce json @Param action body models.Action true "Action definition (json)" @Security Bearer @Success 200 {object} models.Action "action" @Failure 400 "Status Bad Request" @Failure 500 "Status" internal server error" @Router /engine/actions/validate [post]

func ValidateFact

func ValidateFact(w http.ResponseWriter, r *http.Request)

ValidateFact godoc @Summary Validate a new fact definition @Description Validate a new fact definition @Tags Facts @Accept json @Produce json @Param fact body interface{} true "Fact definition (json)" @Security Bearer @Success 200 "Status OK" @Failure 400 "Status Bad Request" @Failure 500 "Status" internal server error" @Router /engine/facts/validate [post]

func ValidateJobSchedule

func ValidateJobSchedule(w http.ResponseWriter, r *http.Request)

ValidateJobSchedule godoc @Summary validate a new JobSchedule definition @Description validate a new JobSchedule definition @Tags Scheduler @Accept json @Produce json @Param job body scheduler.InternalSchedule true "JobSchedule definition (json)" @Security Bearer @Success 200 {object} scheduler.InternalSchedule "schedule" @Failure 400 "Status Bad Request" @Router /engine/scheduler/jobs/validate [post]

func ValidateModel

func ValidateModel(w http.ResponseWriter, r *http.Request)

ValidateModel godoc @Summary Validate a new model definition @Description Validate a new model definition @Tags Models @Accept json @Produce json @Param model body interface{} true "Model definition (json)" @Security Bearer @Success 200 "Status OK" @Failure 400 "Status Bad Request" @Failure 500 "Status" internal server error" @Router /engine/models/validate [post]

func ValidatePermission

func ValidatePermission(w http.ResponseWriter, r *http.Request)

ValidatePermission godoc @Summary Validate a new permission definition @Description Validate a new permission definition @Tags Permissions @Accept json @Produce json @Param permission body permissions.Permission true "permission (json)" @Security Bearer @Success 200 {object} permissions.Permission "permission" @Failure 400 {string} string "Bad Request" @Failure 500 {string} string "Internal Server Error" @Router /admin/security/permissions/validate [post]

func ValidateRole

func ValidateRole(w http.ResponseWriter, r *http.Request)

ValidateRole godoc @Summary Validate a new role definition @Description Validate a new role definition @Tags Roles @Accept json @Produce json @Param role body roles.Role true "role (json)" @Security Bearer @Success 200 {object} roles.Role "role" @Failure 400 {string} string "Bad Request" @Failure 500 {string} string "Internal Server Error" @Router /admin/security/roles/validate [post]

func ValidateRootCause

func ValidateRootCause(w http.ResponseWriter, r *http.Request)

ValidateRootCause godoc @Summary Validate a new rootcause definition @Description Validate a new rootcause definition @Tags RootCauses @Accept json @Produce json @Param rootcause body models.RootCause true "RootCause definition (json)" @Security Bearer @Success 200 {object} models.RootCause "rootcause" @Failure 400 "Status Bad Request" @Failure 500 "Status" internal server error" @Router /engine/rootcauses/validate [post]

func ValidateRule

func ValidateRule(w http.ResponseWriter, r *http.Request)

ValidateRule godoc @Summary validate a new rule definition @Description validate a new rule definition @Tags Rules @Accept json @Produce json @Param rule body rule.Rule true "Rule definition (json)" @Security Bearer @Success 200 {object} rule.Rule "rule" @Failure 400 "Status Bad Request" @Failure 500 "Status Internal Server Error" @Router /engine/rules/validate [post]

func ValidateSituation

func ValidateSituation(w http.ResponseWriter, r *http.Request)

ValidateSituation godoc @Summary Validate a new situation definition @Description Validate a new situation definition @Tags Situations @Accept json @Produce json @Param situation body situation.Situation true "Situation definition (json)" @Security Bearer @Success 200 {object} situation.Situation "situation" @Failure 400 "Status Bad Request" @Failure 500 "Status" internal server error" @Router /engine/situations/validate [post]

func ValidateUser

func ValidateUser(w http.ResponseWriter, r *http.Request)

ValidateUser godoc @Summary Validate a new user definition @Description Validate a new user definition @Tags Users @Accept json @Produce json @Param user body users.User true "user (json)" @Security Bearer @Success 200 {object} users.User "user" @Failure 400 {string} string "Bad Request" @Failure 500 {string} string "Internal Server Error" @Router /admin/security/users/validate [post]

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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