Documentation ¶
Overview ¶
Package inventory contains inventory business logic: Nodes, Services, Agents.
Index ¶
- type AgentsService
- func (as *AgentsService) AddExternalExporter(req *inventorypb.AddExternalExporterRequest) (*inventorypb.ExternalExporter, error)
- func (as *AgentsService) AddMongoDBExporter(ctx context.Context, req *inventorypb.AddMongoDBExporterRequest) (*inventorypb.MongoDBExporter, error)
- func (as *AgentsService) AddMySQLdExporter(ctx context.Context, req *inventorypb.AddMySQLdExporterRequest) (*inventorypb.MySQLdExporter, int32, error)
- func (as *AgentsService) AddNodeExporter(ctx context.Context, req *inventorypb.AddNodeExporterRequest) (*inventorypb.NodeExporter, error)
- func (as *AgentsService) AddPMMAgent(ctx context.Context, req *inventorypb.AddPMMAgentRequest) (*inventorypb.PMMAgent, error)
- func (as *AgentsService) AddPostgresExporter(ctx context.Context, req *inventorypb.AddPostgresExporterRequest) (*inventorypb.PostgresExporter, error)
- func (as *AgentsService) AddProxySQLExporter(ctx context.Context, req *inventorypb.AddProxySQLExporterRequest) (*inventorypb.ProxySQLExporter, error)
- func (as *AgentsService) AddQANMongoDBProfilerAgent(ctx context.Context, req *inventorypb.AddQANMongoDBProfilerAgentRequest) (*inventorypb.QANMongoDBProfilerAgent, error)
- func (as *AgentsService) AddQANMySQLPerfSchemaAgent(ctx context.Context, req *inventorypb.AddQANMySQLPerfSchemaAgentRequest) (*inventorypb.QANMySQLPerfSchemaAgent, error)
- func (as *AgentsService) AddQANMySQLSlowlogAgent(ctx context.Context, req *inventorypb.AddQANMySQLSlowlogAgentRequest) (*inventorypb.QANMySQLSlowlogAgent, error)
- func (as *AgentsService) AddQANPostgreSQLPgStatementsAgent(ctx context.Context, req *inventorypb.AddQANPostgreSQLPgStatementsAgentRequest) (*inventorypb.QANPostgreSQLPgStatementsAgent, error)
- func (as *AgentsService) AddRDSExporter(ctx context.Context, req *inventorypb.AddRDSExporterRequest) (*inventorypb.RDSExporter, error)
- func (as *AgentsService) ChangeExternalExporter(req *inventorypb.ChangeExternalExporterRequest) (*inventorypb.ExternalExporter, error)
- func (as *AgentsService) ChangeMongoDBExporter(ctx context.Context, req *inventorypb.ChangeMongoDBExporterRequest) (*inventorypb.MongoDBExporter, error)
- func (as *AgentsService) ChangeMySQLdExporter(ctx context.Context, req *inventorypb.ChangeMySQLdExporterRequest) (*inventorypb.MySQLdExporter, error)
- func (as *AgentsService) ChangeNodeExporter(ctx context.Context, req *inventorypb.ChangeNodeExporterRequest) (*inventorypb.NodeExporter, error)
- func (as *AgentsService) ChangePostgresExporter(ctx context.Context, req *inventorypb.ChangePostgresExporterRequest) (*inventorypb.PostgresExporter, error)
- func (as *AgentsService) ChangeProxySQLExporter(ctx context.Context, req *inventorypb.ChangeProxySQLExporterRequest) (*inventorypb.ProxySQLExporter, error)
- func (as *AgentsService) ChangeQANMongoDBProfilerAgent(ctx context.Context, req *inventorypb.ChangeQANMongoDBProfilerAgentRequest) (*inventorypb.QANMongoDBProfilerAgent, error)
- func (as *AgentsService) ChangeQANMySQLPerfSchemaAgent(ctx context.Context, req *inventorypb.ChangeQANMySQLPerfSchemaAgentRequest) (*inventorypb.QANMySQLPerfSchemaAgent, error)
- func (as *AgentsService) ChangeQANMySQLSlowlogAgent(ctx context.Context, req *inventorypb.ChangeQANMySQLSlowlogAgentRequest) (*inventorypb.QANMySQLSlowlogAgent, error)
- func (as *AgentsService) ChangeQANPostgreSQLPgStatementsAgent(ctx context.Context, ...) (*inventorypb.QANPostgreSQLPgStatementsAgent, error)
- func (as *AgentsService) ChangeRDSExporter(ctx context.Context, req *inventorypb.ChangeRDSExporterRequest) (*inventorypb.RDSExporter, error)
- func (as *AgentsService) Get(ctx context.Context, id string) (inventorypb.Agent, error)
- func (as *AgentsService) List(ctx context.Context, filters models.AgentFilters) ([]inventorypb.Agent, error)
- func (as *AgentsService) Remove(ctx context.Context, id string, force bool) error
- type NodesService
- func (s *NodesService) AddContainerNode(ctx context.Context, req *inventorypb.AddContainerNodeRequest) (*inventorypb.ContainerNode, error)
- func (s *NodesService) AddGenericNode(ctx context.Context, req *inventorypb.AddGenericNodeRequest) (*inventorypb.GenericNode, error)
- func (s *NodesService) AddRemoteNode(ctx context.Context, req *inventorypb.AddRemoteNodeRequest) (*inventorypb.RemoteNode, error)
- func (s *NodesService) AddRemoteRDSNode(ctx context.Context, req *inventorypb.AddRemoteRDSNodeRequest) (*inventorypb.RemoteRDSNode, error)
- func (s *NodesService) Get(ctx context.Context, req *inventorypb.GetNodeRequest) (inventorypb.Node, error)
- func (s *NodesService) List(ctx context.Context, filters models.NodeFilters) ([]inventorypb.Node, error)
- func (s *NodesService) Remove(ctx context.Context, id string, force bool) error
- type ServicesService
- func (ss *ServicesService) AddExternalService(ctx context.Context, params *models.AddDBMSServiceParams) (*inventorypb.ExternalService, error)
- func (ss *ServicesService) AddMongoDB(ctx context.Context, params *models.AddDBMSServiceParams) (*inventorypb.MongoDBService, error)
- func (ss *ServicesService) AddMySQL(ctx context.Context, params *models.AddDBMSServiceParams) (*inventorypb.MySQLService, error)
- func (ss *ServicesService) AddPostgreSQL(ctx context.Context, params *models.AddDBMSServiceParams) (*inventorypb.PostgreSQLService, error)
- func (ss *ServicesService) AddProxySQL(ctx context.Context, params *models.AddDBMSServiceParams) (*inventorypb.ProxySQLService, error)
- func (ss *ServicesService) Get(ctx context.Context, id string) (inventorypb.Service, error)
- func (ss *ServicesService) List(ctx context.Context, filters models.ServiceFilters) ([]inventorypb.Service, error)
- func (ss *ServicesService) Remove(ctx context.Context, id string, force bool) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentsService ¶
type AgentsService struct {
// contains filtered or unexported fields
}
AgentsService works with inventory API Agents.
func NewAgentsService ¶
func NewAgentsService(db *reform.DB, r agentsRegistry, prometheus prometheusService) *AgentsService
NewAgentsService creates new AgentsService
func (*AgentsService) AddExternalExporter ¶
func (as *AgentsService) AddExternalExporter(req *inventorypb.AddExternalExporterRequest) (*inventorypb.ExternalExporter, error)
AddExternalExporter inserts external-exporter Agent with given parameters.
func (*AgentsService) AddMongoDBExporter ¶
func (as *AgentsService) AddMongoDBExporter(ctx context.Context, req *inventorypb.AddMongoDBExporterRequest) (*inventorypb.MongoDBExporter, error)
AddMongoDBExporter inserts mongodb_exporter Agent with given parameters.
func (*AgentsService) AddMySQLdExporter ¶
func (as *AgentsService) AddMySQLdExporter(ctx context.Context, req *inventorypb.AddMySQLdExporterRequest) (*inventorypb.MySQLdExporter, int32, error)
AddMySQLdExporter inserts mysqld_exporter Agent with given parameters and returns it and an actual table count.
func (*AgentsService) AddNodeExporter ¶
func (as *AgentsService) AddNodeExporter(ctx context.Context, req *inventorypb.AddNodeExporterRequest) (*inventorypb.NodeExporter, error)
AddNodeExporter inserts node_exporter Agent with given parameters.
func (*AgentsService) AddPMMAgent ¶
func (as *AgentsService) AddPMMAgent(ctx context.Context, req *inventorypb.AddPMMAgentRequest) (*inventorypb.PMMAgent, error)
AddPMMAgent inserts pmm-agent Agent with given parameters.
func (*AgentsService) AddPostgresExporter ¶
func (as *AgentsService) AddPostgresExporter(ctx context.Context, req *inventorypb.AddPostgresExporterRequest) (*inventorypb.PostgresExporter, error)
AddPostgresExporter inserts postgres_exporter Agent with given parameters.
func (*AgentsService) AddProxySQLExporter ¶
func (as *AgentsService) AddProxySQLExporter(ctx context.Context, req *inventorypb.AddProxySQLExporterRequest) (*inventorypb.ProxySQLExporter, error)
AddProxySQLExporter inserts proxysql_exporter Agent with given parameters.
func (*AgentsService) AddQANMongoDBProfilerAgent ¶
func (as *AgentsService) AddQANMongoDBProfilerAgent(ctx context.Context, req *inventorypb.AddQANMongoDBProfilerAgentRequest) (*inventorypb.QANMongoDBProfilerAgent, error)
AddQANMongoDBProfilerAgent adds MongoDB Profiler QAN Agent.
func (*AgentsService) AddQANMySQLPerfSchemaAgent ¶
func (as *AgentsService) AddQANMySQLPerfSchemaAgent(ctx context.Context, req *inventorypb.AddQANMySQLPerfSchemaAgentRequest) (*inventorypb.QANMySQLPerfSchemaAgent, error)
AddQANMySQLPerfSchemaAgent adds MySQL PerfSchema QAN Agent.
func (*AgentsService) AddQANMySQLSlowlogAgent ¶
func (as *AgentsService) AddQANMySQLSlowlogAgent(ctx context.Context, req *inventorypb.AddQANMySQLSlowlogAgentRequest) (*inventorypb.QANMySQLSlowlogAgent, error)
AddQANMySQLSlowlogAgent adds MySQL Slowlog QAN Agent.
func (*AgentsService) AddQANPostgreSQLPgStatementsAgent ¶
func (as *AgentsService) AddQANPostgreSQLPgStatementsAgent(ctx context.Context, req *inventorypb.AddQANPostgreSQLPgStatementsAgentRequest) (*inventorypb.QANPostgreSQLPgStatementsAgent, error)
AddQANPostgreSQLPgStatementsAgent adds PostgreSQL Pg stat statements QAN Agent.
func (*AgentsService) AddRDSExporter ¶
func (as *AgentsService) AddRDSExporter(ctx context.Context, req *inventorypb.AddRDSExporterRequest) (*inventorypb.RDSExporter, error)
AddRDSExporter inserts rds_exporter Agent with given parameters.
func (*AgentsService) ChangeExternalExporter ¶
func (as *AgentsService) ChangeExternalExporter(req *inventorypb.ChangeExternalExporterRequest) (*inventorypb.ExternalExporter, error)
ChangeExternalExporter updates external-exporter Agent with given parameters.
func (*AgentsService) ChangeMongoDBExporter ¶
func (as *AgentsService) ChangeMongoDBExporter(ctx context.Context, req *inventorypb.ChangeMongoDBExporterRequest) (*inventorypb.MongoDBExporter, error)
ChangeMongoDBExporter updates mongo_exporter Agent with given parameters.
func (*AgentsService) ChangeMySQLdExporter ¶
func (as *AgentsService) ChangeMySQLdExporter(ctx context.Context, req *inventorypb.ChangeMySQLdExporterRequest) (*inventorypb.MySQLdExporter, error)
ChangeMySQLdExporter updates mysqld_exporter Agent with given parameters.
func (*AgentsService) ChangeNodeExporter ¶
func (as *AgentsService) ChangeNodeExporter(ctx context.Context, req *inventorypb.ChangeNodeExporterRequest) (*inventorypb.NodeExporter, error)
ChangeNodeExporter updates node_exporter Agent with given parameters.
func (*AgentsService) ChangePostgresExporter ¶
func (as *AgentsService) ChangePostgresExporter(ctx context.Context, req *inventorypb.ChangePostgresExporterRequest) (*inventorypb.PostgresExporter, error)
ChangePostgresExporter updates postgres_exporter Agent with given parameters.
func (*AgentsService) ChangeProxySQLExporter ¶
func (as *AgentsService) ChangeProxySQLExporter(ctx context.Context, req *inventorypb.ChangeProxySQLExporterRequest) (*inventorypb.ProxySQLExporter, error)
ChangeProxySQLExporter updates proxysql_exporter Agent with given parameters.
func (*AgentsService) ChangeQANMongoDBProfilerAgent ¶
func (as *AgentsService) ChangeQANMongoDBProfilerAgent(ctx context.Context, req *inventorypb.ChangeQANMongoDBProfilerAgentRequest) (*inventorypb.QANMongoDBProfilerAgent, error)
ChangeQANMongoDBProfilerAgent updates MongoDB Profiler QAN Agent with given parameters.
func (*AgentsService) ChangeQANMySQLPerfSchemaAgent ¶
func (as *AgentsService) ChangeQANMySQLPerfSchemaAgent(ctx context.Context, req *inventorypb.ChangeQANMySQLPerfSchemaAgentRequest) (*inventorypb.QANMySQLPerfSchemaAgent, error)
ChangeQANMySQLPerfSchemaAgent updates MySQL PerfSchema QAN Agent with given parameters.
func (*AgentsService) ChangeQANMySQLSlowlogAgent ¶
func (as *AgentsService) ChangeQANMySQLSlowlogAgent(ctx context.Context, req *inventorypb.ChangeQANMySQLSlowlogAgentRequest) (*inventorypb.QANMySQLSlowlogAgent, error)
ChangeQANMySQLSlowlogAgent updates MySQL Slowlog QAN Agent with given parameters.
func (*AgentsService) ChangeQANPostgreSQLPgStatementsAgent ¶
func (as *AgentsService) ChangeQANPostgreSQLPgStatementsAgent(ctx context.Context, req *inventorypb.ChangeQANPostgreSQLPgStatementsAgentRequest) (*inventorypb.QANPostgreSQLPgStatementsAgent, error)
ChangeQANPostgreSQLPgStatementsAgent updates PostgreSQL Pg stat statements QAN Agent with given parameters.
func (*AgentsService) ChangeRDSExporter ¶
func (as *AgentsService) ChangeRDSExporter(ctx context.Context, req *inventorypb.ChangeRDSExporterRequest) (*inventorypb.RDSExporter, error)
ChangeRDSExporter updates rds_exporter Agent with given parameters.
func (*AgentsService) Get ¶
func (as *AgentsService) Get(ctx context.Context, id string) (inventorypb.Agent, error)
Get selects a single Agent by ID.
func (*AgentsService) List ¶
func (as *AgentsService) List(ctx context.Context, filters models.AgentFilters) ([]inventorypb.Agent, error)
List selects all Agents in a stable order for a given service.
type NodesService ¶
type NodesService struct {
// contains filtered or unexported fields
}
func NewNodesService ¶
func NewNodesService(db *reform.DB) *NodesService
NewNodesService returns Inventory API handler for managing Nodes.
func (*NodesService) AddContainerNode ¶
func (s *NodesService) AddContainerNode(ctx context.Context, req *inventorypb.AddContainerNodeRequest) (*inventorypb.ContainerNode, error)
AddContainerNode adds Container Node.
func (*NodesService) AddGenericNode ¶
func (s *NodesService) AddGenericNode(ctx context.Context, req *inventorypb.AddGenericNodeRequest) (*inventorypb.GenericNode, error)
AddGenericNode adds Generic Node.
func (*NodesService) AddRemoteNode ¶
func (s *NodesService) AddRemoteNode(ctx context.Context, req *inventorypb.AddRemoteNodeRequest) (*inventorypb.RemoteNode, error)
AddRemoteNode adds Remote Node.
func (*NodesService) AddRemoteRDSNode ¶
func (s *NodesService) AddRemoteRDSNode(ctx context.Context, req *inventorypb.AddRemoteRDSNodeRequest) (*inventorypb.RemoteRDSNode, error)
AddRemoteRDSNode adds a new RDS node
func (*NodesService) Get ¶
func (s *NodesService) Get(ctx context.Context, req *inventorypb.GetNodeRequest) (inventorypb.Node, error)
Get returns a single Node by ID.
func (*NodesService) List ¶
func (s *NodesService) List(ctx context.Context, filters models.NodeFilters) ([]inventorypb.Node, error)
List returns a list of all Nodes.
type ServicesService ¶
type ServicesService struct {
// contains filtered or unexported fields
}
ServicesService works with inventory API Services.
func NewServicesService ¶
func NewServicesService(db *reform.DB, r agentsRegistry) *ServicesService
NewServicesService creates new ServicesService
func (*ServicesService) AddExternalService ¶
func (ss *ServicesService) AddExternalService(ctx context.Context, params *models.AddDBMSServiceParams) (*inventorypb.ExternalService, error)
AddExternalService inserts External Service with given parameters.
func (*ServicesService) AddMongoDB ¶
func (ss *ServicesService) AddMongoDB(ctx context.Context, params *models.AddDBMSServiceParams) (*inventorypb.MongoDBService, error)
AddMongoDB inserts MongoDB Service with given parameters.
func (*ServicesService) AddMySQL ¶
func (ss *ServicesService) AddMySQL(ctx context.Context, params *models.AddDBMSServiceParams) (*inventorypb.MySQLService, error)
AddMySQL inserts MySQL Service with given parameters.
func (*ServicesService) AddPostgreSQL ¶
func (ss *ServicesService) AddPostgreSQL(ctx context.Context, params *models.AddDBMSServiceParams) (*inventorypb.PostgreSQLService, error)
AddPostgreSQL inserts PostgreSQL Service with given parameters.
func (*ServicesService) AddProxySQL ¶
func (ss *ServicesService) AddProxySQL(ctx context.Context, params *models.AddDBMSServiceParams) (*inventorypb.ProxySQLService, error)
AddProxySQL inserts ProxySQL Service with given parameters.
func (*ServicesService) Get ¶
func (ss *ServicesService) Get(ctx context.Context, id string) (inventorypb.Service, error)
Get selects a single Service by ID.
func (*ServicesService) List ¶
func (ss *ServicesService) List(ctx context.Context, filters models.ServiceFilters) ([]inventorypb.Service, error)
List selects all Services in a stable order.