示例#1
0
// POST /api/process
func AddMaintenanceToCurrentOrg(c *middleware.Context, cmd m.AddMaintenanceCommand) Response {

	logger := log.New("main")
	logger.Info("Add ProcessForCurrentOrg", cmd.Org)
	cmd.Org = c.OrgId

	return addMaintenanceHelper(cmd)
}
示例#2
0
// add a machine
func addMaintenanceHelper(cmd m.AddMaintenanceCommand) Response {

	logger := log.New("main")
	logger.Info("Add ProcessForCurrentOrg111", cmd.Org)
	query := m.AddMaintenanceCommand{}

	query.Org = cmd.Org
	query.Component = cmd.Component
	query.Parameter = cmd.Parameter
	query.Message = cmd.Message
	query.Interval = cmd.Interval

	if err := bus.Dispatch(&query); err != nil {
		return ApiError(500, "Could not add Maintenance to organization", err)
	}

	return ApiSuccess("Maintenance Sucessfully added ")

}