api

package
v0.0.0-...-67af0ea Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2025 License: Apache-2.0 Imports: 47 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateOrUpdateSilencer

func CreateOrUpdateSilencer(ctx *gin.Context)

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

func DeleteSilencer(ctx *gin.Context)

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 ForwardToActiveAgentWrapper

func ForwardToActiveAgentWrapper(f func(*gin.Context)) func(*gin.Context)

func GetAgentStatus

func GetAgentStatus(s *http.State) (http.AgentStatus, error)

func GetAlertmanagerConfig

func GetAlertmanagerConfig(c *gin.Context)

@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

func GetHostInfo(c *gin.Context)

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

func GetPrometheusConfig(c *gin.Context)

@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

func GetRule(ctx *gin.Context)

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

func GetSilencer(ctx *gin.Context)

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

func GetStatistics(c *gin.Context)

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

func GitInfoHandler(c *gin.Context)

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

func InitOcsAgentRoutes(s *http2.State, r *gin.Engine, isLocalRoute bool)

@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

func ListAlerts(ctx *gin.Context)

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

func ListMetricMetas(c *gin.Context)

@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

func ListRules(ctx *gin.Context)

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

func ListSilencers(ctx *gin.Context)

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

func QueryMetrics(c *gin.Context)

@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

func SetAlertmanagerConfig(c *gin.Context)

@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

func SetPrometheusConfig(c *gin.Context)

@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

func TimeHandler(c *gin.Context)

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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