Documentation
¶
Overview ¶
* Copyright (c) 2024 OceanBase. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Copyright (c) 2024 OceanBase. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Copyright (c) 2024 OceanBase. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Copyright (c) 2024 OceanBase. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Copyright (c) 2024 OceanBase. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
Index ¶
- func CreateOrUpdateSilencer(ctx *gin.Context)
- func DeleteSilencer(ctx *gin.Context)
- func ForwardToActiveAgentWrapper(f func(*gin.Context)) func(*gin.Context)
- func GetAgentStatus(s *http.State) (http.AgentStatus, error)
- func GetAlertmanagerConfig(c *gin.Context)
- func GetAllAgentStatus(s *http.State) gin.HandlerFunc
- func GetExecuteAgentForTenant(tenantName string) (meta.AgentInfoInterface, error)
- func GetHostInfo(c *gin.Context)
- func GetPrometheusConfig(c *gin.Context)
- func GetRule(ctx *gin.Context)
- func GetSilencer(ctx *gin.Context)
- func GetStatistics(c *gin.Context)
- func GitInfoHandler(c *gin.Context)
- func InfoHandler(s *http.State) gin.HandlerFunc
- func InitAlarmRoutes(parentGroup *gin.RouterGroup, isLocalRoute bool)
- func InitBackupRoutes(v1 *gin.RouterGroup, isLocalRoute bool)
- func InitExternalRoutes(r *gin.RouterGroup, isLocalRoute bool)
- func InitMetricRoutes(r *gin.RouterGroup, isLocalRoute bool)
- func InitObproxyRoutes(r *gin.RouterGroup, isLocalRoute bool)
- func InitOcsAgentRoutes(s *http2.State, r *gin.Engine, isLocalRoute bool)
- func InitRestoreRoutes(r *gin.RouterGroup, isLocalRoute bool)
- func InitTaskRoutes(r *gin.RouterGroup, isLocalRoute bool)
- func InitTenantRoutes(v1 *gin.RouterGroup, isLocalRoute bool)
- func ListAlerts(ctx *gin.Context)
- func ListMetricMetas(c *gin.Context)
- func ListRules(ctx *gin.Context)
- func ListSilencers(ctx *gin.Context)
- func QueryMetrics(c *gin.Context)
- func SetAlertmanagerConfig(c *gin.Context)
- func SetPrometheusConfig(c *gin.Context)
- func StatusHandler(s *http.State) gin.HandlerFunc
- func TimeHandler(c *gin.Context)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateOrUpdateSilencer ¶
CreateOrUpdateSilencer godoc @ID CreateOrUpdateSilencer @Summary Create or update a silencer @Description Create or update a silencer @Tags alarm @Accept json @Produce json @Param silencer body silence.SilencerParam true "silencer" @Success 200 {object} http.OcsAgentResponse{data=silence.SilencerResponse} @Router /api/v1/alarm/silencer [put]
func DeleteSilencer ¶
DeleteSilencer godoc @ID DeleteSilencer @Summary Delete a silencer @Description Delete a silencer by id @Tags alarm @Accept json @Produce json @Param id path string true "silencer id" @Success 200 {object} http.OcsAgentResponse @Router /api/v1/alarm/silencer/{id} [delete]
func GetAgentStatus ¶
func GetAgentStatus(s *http.State) (http.AgentStatus, error)
func GetAlertmanagerConfig ¶
@Summary Get Alertmanager configuration @Description Get Alertmanager configuration @Tags system @Accept json @Produce json @Success 200 {object} http.OcsAgentResponse{data=external.AlertmanagerConfig} @Failure 500 {object} http.OcsAgentResponse @Router /api/v1/system/external/alertmanager [get]
func GetAllAgentStatus ¶
func GetAllAgentStatus(s *http.State) gin.HandlerFunc
StatusHandler returns the agent status
@ID getAllAgentsStatus @Summary get all agent status @Description get all agent status @Tags v1 @Accept application/json @Produce application/json @Success 200 object http.OcsAgentResponse{data=map[string]http.AgentStatus} @Router /api/v1/agents/status [get]
func GetExecuteAgentForTenant ¶
func GetExecuteAgentForTenant(tenantName string) (meta.AgentInfoInterface, error)
func GetHostInfo ¶
GitHostInfo returns the host info
@ID GetHostInfo @Summary get host info @Description get host info @Tags agent @Accept application/json @Produce application/json @Success 200 object http.OcsAgentResponse{data=bo.HostInfo} @Router /api/v1/agent/host-info [GET]
func GetPrometheusConfig ¶
@Summary Get Prometheus configuration @Description Get Prometheus configuration @Tags system @Accept json @Produce json @Success 200 {object} http.OcsAgentResponse{data=external.PrometheusConfig} @Failure 500 {object} http.OcsAgentResponse @Router /api/v1/system/external/prometheus [get]
func GetRule ¶
GetRule godoc @ID GetRule @Summary Get a rule @Description Get a rule by name @Tags alarm @Accept json @Produce json @Param name path string true "rule name" @Success 200 {object} http.OcsAgentResponse{data=rule.RuleResponse} @Router /api/v1/alarm/rule/{name} [get]
func GetSilencer ¶
GetSilencer godoc @ID GetSilencer @Summary Get a silencer @Description Get a silencer by id @Tags alarm @Accept json @Produce json @Param id path string true "silencer id" @Success 200 {object} http.OcsAgentResponse{data=silence.SilencerResponse} @Router /api/v1/alarm/silencer/{id} [get]
func GetStatistics ¶
StatisticsHandler returns the statistics data
@ID GetStatistics @Summary get statistics data @Description get statistics data @Tags ob @Accept application/json @Produce application/json @Success 200 object http.OcsAgentResponse{data=bo.ObclusterStatisticInfo} @Failure 400 object http.OcsAgentResponse @Failure 401 object http.OcsAgentResponse @Failure 500 object http.OcsAgentResponse @Router /api/v1/obcluster/statistics [GET]
func GitInfoHandler ¶
GitInfoHandler returns the agent git info
@ID getGitInfo @Summary get git info @Description get git info @Tags v1 @Accept application/json @Produce application/json @Success 200 object http.OcsAgentResponse{data=config.GitInfo} @Router /api/v1/git-info [get]
func InfoHandler ¶
func InfoHandler(s *http.State) gin.HandlerFunc
InfoHandler returns the agent info
@ID getAgentInfo @Summary get agent info @Description get agent info @Tags v1 @Accept application/json @Produce application/json @Success 200 object http.OcsAgentResponse{data=meta.AgentStatus} @Router /api/v1/info [get]
func InitAlarmRoutes ¶
func InitAlarmRoutes(parentGroup *gin.RouterGroup, isLocalRoute bool)
func InitBackupRoutes ¶
func InitBackupRoutes(v1 *gin.RouterGroup, isLocalRoute bool)
func InitExternalRoutes ¶
func InitExternalRoutes(r *gin.RouterGroup, isLocalRoute bool)
func InitMetricRoutes ¶
func InitMetricRoutes(r *gin.RouterGroup, isLocalRoute bool)
func InitObproxyRoutes ¶
func InitObproxyRoutes(r *gin.RouterGroup, isLocalRoute bool)
func InitOcsAgentRoutes ¶
@title obshell API @version 1.0 @description This is a set of operation and maintenance management API interfaces developed based on observer. @BasePath / @contact.name obshell API Support @contact.url https://open.oceanbase.com @license.name Apache - 2.0 @license.url http://www.apache.org/licenses/
func InitRestoreRoutes ¶
func InitRestoreRoutes(r *gin.RouterGroup, isLocalRoute bool)
func InitTaskRoutes ¶
func InitTaskRoutes(r *gin.RouterGroup, isLocalRoute bool)
func InitTenantRoutes ¶
func InitTenantRoutes(v1 *gin.RouterGroup, isLocalRoute bool)
func ListAlerts ¶
ListAlerts godoc @ID ListAlerts @Summary List all alerts @Description List all alerts @Tags alarm @Accept json @Produce json @Param filter body alert.AlertFilter false "alert filter" @Success 200 {object} http.OcsAgentResponse{data=[]alert.Alert} @Router /api/v1/alarm/alerts [post]
func ListMetricMetas ¶
@ID ListAllMetrics @Summary list all metrics @Description list all metrics meta info, return by groups @Tags Metric @Accept application/json @Produce application/json @Param scope query string true "metrics scope" Enums(OBCLUSTER, OBTENANT) @Success 200 object http.OcsAgentResponse{data=[]metric.MetricClass} @Failure 400 object http.OcsAgentResponse @Failure 401 object http.OcsAgentResponse @Failure 500 object http.OcsAgentResponse @Router /api/v1/metrics [GET] @Security ApiKeyAuth
func ListRules ¶
ListRules godoc @ID ListRules @Summary List all rules @Description List all rules @Tags alarm @Accept json @Produce json @Param filter body rule.RuleFilter false "rule filter" @Success 200 {object} http.OcsAgentResponse{data=[]rule.RuleResponse} @Router /api/v1/alarm/rules [post]
func ListSilencers ¶
ListSilencers godoc @ID ListSilencers @Summary List all silencers @Description List all silencers @Tags alarm @Accept json @Produce json @Param filter body silence.SilencerFilter false "silencer filter" @Success 200 {object} http.OcsAgentResponse{data=[]silence.SilencerResponse} @Router /api/v1/alarm/silencers [post]
func QueryMetrics ¶
@ID QueryMetrics @Summary query metrics @Description query metric data @Tags Metric @Accept application/json @Produce application/json @Param body body metric.MetricQuery true "metric query request body" @Success 200 object http.OcsAgentResponse{data=[]metric.MetricData} @Failure 400 object http.OcsAgentResponse @Failure 401 object http.OcsAgentResponse @Failure 500 object http.OcsAgentResponse @Router /api/v1/metrics/query [POST] @Security ApiKeyAuth
func SetAlertmanagerConfig ¶
@Summary Set Alertmanager configuration @Description Set Alertmanager configuration @Tags system @Accept json @Produce json @Param config body external.AlertmanagerConfig true "Alertmanager configuration" @Success 200 {object} http.OcsAgentResponse @Failure 400 {object} http.OcsAgentResponse @Failure 500 {object} http.OcsAgentResponse @Router /api/v1/system/external/alertmanager [put]
func SetPrometheusConfig ¶
@Summary Set Prometheus configuration @Description Set Prometheus configuration @Tags system @Accept json @Produce json @Param config body external.PrometheusConfig true "Prometheus configuration" @Success 200 {object} http.OcsAgentResponse @Failure 400 {object} http.OcsAgentResponse @Failure 500 {object} http.OcsAgentResponse @Router /api/v1/system/external/prometheus [put]
func StatusHandler ¶
func StatusHandler(s *http.State) gin.HandlerFunc
StatusHandler returns the agent status
@ID getStatus @Summary get agent status @Description get agent status @Tags v1 @Accept application/json @Produce application/json @Success 200 object http.OcsAgentResponse{data=http.AgentStatus} @Router /api/v1/status [get]
func TimeHandler ¶
TimeHandler returns the current time
@ID getTime @Summary get current time @Description get current time @Tags v1 @Accept application/json @Produce application/json @Success 200 object http.OcsAgentResponse{data=time.Time} @Router /api/v1/time [get]
Types ¶
This section is empty.
Source Files
¶
- agent_handler.go
- agent_route.go
- alarm_handler.go
- alarm_route.go
- backup_route.go
- empty.go
- external_handler.go
- external_route.go
- frontend_router.go
- info_handler.go
- metric_handler.go
- metric_route.go
- obcluster_handler.go
- obproxy_route.go
- pool_handler.go
- recyclebin_handler.go
- restore_route.go
- secure_handler.go
- task_handler.go
- tenant_handler.go
- tenant_utils.go
- unit_handler.go
- utils.go
- zone_handler.go